# true data
x<-rnorm(100,0,1) # N(0,1)
y<-rnorm(100,(1+2*x),1.2) # y ~ 1 + 2*x + N(0,1.2)
# create artificial missingness on y
y[seq(2,100,10)]<-NA
dat.xy <- data.frame(x,y)
# imputation
dat.cont.mi <- mi.continuous(y~x, data = dat.xy)
mi.hist( dat.cont.mi, y)
# imputation
#dat.mi <- mi(dat.xy)
#mi.hist( imp(dat.mi,1)[["y"]], y)
Run the code above in your browser using DataLab