Learn R Programming

setweaver (version 1.0.0)

jtct: jtct

Description

Counts the number of complete observations where both a binary outcome `y` and a binary predictor `x` equal 1. Missing values are excluded pairwise (rows with `NA` in either `x` or `y` are ignored).

Usage

jtct(y, x)

Value

An integer scalar giving the number of observations where `x == 1` and `y == 1`, after excluding missing values.

Arguments

y

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

x

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

Examples

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

Run the code above in your browser using DataLab