This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "impute" missing binary predictor | |
# really just marginalizes over missingness | |
# imputed values produced in generated quantities | |
N <- 1000 # number of cases | |
N_miss <- 100 # number missing values | |
x_baserate <- 0.25 # prob x==1 in total sample | |
a <- 0 # intercept in y ~ N( a+b*x , 1 ) | |
b <- 1 # slope in y ~ N( a+b*x , 1 ) |