data(studentratings)
# * Example 1: simple imputation
fml <- ReadDis + SES ~ ReadAchiev + (1|ID)
imp <- panImpute(studentratings, formula=fml, n.burn=1000, n.iter=100, m=5)
plot all parameters (default)
plot(imp)
plot(imp, print=c("beta","psi","sigma"))
plot fixed effects only
plot(imp, print="beta")
# export plots to file (using pdf device)
plot(imp, export="pdf", dev.args=list(width=9, height=4, pointsize=12))
# * Example 2: groupwise imputation
fml <- ReadDis + SES ~ ReadAchiev + (1|ID)
imp <- panImpute(studentratings, formula=fml, group=FedState, n.burn=1000,
n.iter=100, m=5)
plot fixed effects for all groups (default for 'group')
plot(imp, print="beta", group="all")
plot fixed effects for first group only
plot(imp, print="beta", group=1)Run the code above in your browser using DataLab