predLines(object, indata, xname, lev=2, selected=NULL, probs=c(.025,.975),
legend=TRUE, legend.space="top", legend.ncol=4, ...)
lev
. If selected=NULL
, then all groups at that level are
included.(0,1)
used to calculate the lower and upper quantiles from which the error bars are
plotted. Currently, this is only available for a "mlwinfitIGLS" object.legend.space="top"
.legend.ncol=2
.xyplot
.predCurves
library(R2MLwiN)
## Modify the following paths as appropriate.
## MLwiN folder
mlwin = "C:/Program Files (x86)/MLwiN v2.29/"
## MLwiN sample worksheet folder
wspath=paste(mlwin,"/samples/",sep="")
## Example: Normal
formula="normexam~(0|cons+standlrt)+(2|cons+standlrt)+(1|cons)"
levID=c('school','student')
estoptions= list(EstM=1,resi.store.levs=2)
wsfile=paste(wspath,"tutorial.ws",sep="")
inputfile=paste(tempdir(),"/tutorial.dta",sep="")
ws2foreign(wsfile, foreignfile=inputfile, MLwiNPath=mlwin)
library(foreign);indata =read.dta(inputfile)
mymodel=runMLwiN(formula, levID, D="Normal", indata, estoptions,MLwiNPath=mlwin)
predLines(mymodel, indata, xname="standlrt", lev = 2,
selected =c(30,44,53,59), probs=c(.025,.975))
Run the code above in your browser using DataLab