powered by
Computes the conditional probability \(P(Y=1 \mid X=1)\) for two binary vectors `y` and `x`. Rows with missing values in either vector are excluded.
cprob(y, x)
A numeric scalar giving the conditional probability that `y = 1` given `x = 1`.
A binary outcome vector (0/1 or logical). Must be the same length as `x`.
A binary predictor vector (0/1 or logical). Must be the same length as `y`.
cprob(misimdata$y,misimdata$x1)
Run the code above in your browser using DataLab