Learn R Programming

setweaver (version 1.0.0)

joint: joint

Description

Computes the joint probability \(P(X = 1, Y = 1)\) for two binary vectors `x` and `y`. Rows with missing values in either vector are excluded.

Usage

joint(y, x)

Value

A numeric scalar giving the joint probability that both `x = 1` and `y = 1`, calculated as the joint count divided by the number of complete cases.

Arguments

y

A binary outcome vector (0/1 or logical). Must be the same length as `x`.

x

A binary predictor vector (0/1 or logical). Must be the same length as `y`.

Examples

Run this code
joint(misimdata$y,misimdata$x1)

Run the code above in your browser using DataLab