Computes a set of descriptive diagnostics for a binary outcome `y` against one or more predictors in `x`, including marginal probability, conditional probability, absolute and proportional differences between marginal and conditional probabilities, and analogous measures based on . entropy.
entfuns(y, x)A data frame with one row per predictor and the following columns:
Predictor name.
Marginal probability \(P(Y=1)\) computed on complete cases for that predictor.
Marginal probability \(P(X=1)\).
Conditional probability \(P(Y=1 \mid X=1)\).
Absolute difference \(P(Y=1 \mid X=1) - P(Y=1)\).
Percent difference relative to \(P(Y=1)\).
Entropy \(H(Y)\).
Conditional entropy \(H(Y \mid X)\).
Absolute difference \(H(Y) - H(Y \mid X)\).
Percent difference in entropy relative to \(H(Y)\).
A binary outcome vector (0/1 or logical). Length `n`.
A data frame of binary predictors (columns). Must have `n` rows; each column is analyzed separately against `y`.
Inputs are treated as binary (0/1 or logical). Missing values are removed pairwise for each predictor (rows with `NA` in either the outcome or the predictor are excluded for that predictor's calculations).
entfuns(misimdata$y,misimdata[,2:5])
Run the code above in your browser using DataLab