| mlwinfitMCMC-class {R2MLwiN} | R Documentation |
An S4 class that stores the outputs of the fitted MCMC model.
Description
An MLwiN model run via the MCMC estimation method is represented by an "mlwinfitMCMC" object
Slots
NobsComputes the number of complete observations.
DataLengthTotal number of cases.
HierarchyFor each higher level of a multilevel model, returns the number of units at that level, together with the minimum, mean and maximum number of lower-level units nested within units of the current level.
burninAn integer specifying length of the burn-in.
nchainsAn integer specifying number of MCMC chains run.
iterationsAn integer specifying the number of iterations after burn-in.
DA vector specifying the type of distribution to be modelled, which can include
'Normal','Binomial''Poisson','Multinomial','Multivariate Normal', or'Mixed'.FormulaA formula object (or a character string) specifying a multilevel model.
levIDA character string (vector) of the specified level ID(s).
contrastsA list of contrast matrices, one for each factor in the model.
xlevelsA list of levels for the factors in the model.
merrA vector which sets-up measurement errors on predictor variables.
factA list of objects specified for factor analysis, including
nfact,lev.fact,nfactor,factor,loadingandconstr.xcA list of objects specified for cross-classified and/or multiple membership models, including
class,N1,weight,idandcar.FPDisplays the fixed part estimates.
RPDisplays the random part estimates.
FP.covDisplays a covariance matrix of the fixed part estimates.
RP.covDisplays a covariance matrix of the random part estimates.
chainsCaptures the MCMC chains from MLwiN for all parameters.
elapsed.timeCalculates the CPU time used for fitting the model.
BDICBayesian Deviance Information Criterion (DIC)
callThe matched call.
LIKEThe deviance statistic (-2*log(like)).
fact.loadingsIf
factis not empty, then the factor loadings are returned.fact.loadings.sdIf
factis not empty, then the factor loading standard deviationss are returned.fact.covIf
factis not empty, then factor covariances are returned.fact.cov.sdIf
factis not empty, then factor covariance standard deviations are returned.fact.chainsIf
factis not empty, then the factor chains are returned.MIdataIf
dami[1]is one then the mean complete response variableyis returned for each chain, ifdami[1]is two then the SD is also included.imputationsIf
dami[1]is zero, then a list of completed datasets containing complete response variableyis returned.residualIf
resi.storeisTRUE, then the residual estimates at all levels are returned.resi.chainsIf
resi.store.levsis not empty, then the residual chains at these levels are returned.versionThe MLwiN version used to fit the model
dataThe data.frame that was used to fit the model.
An instance of the Class
An instance is created by calling function runMLwiN.
Author(s)
Zhang, Z., Charlton, C.M.J., Parker, R.M.A., Leckie, G., and Browne, W.J. (2016) Centre for Multilevel Modelling, University of Bristol.
See Also
Examples
## Not run:
library(R2MLwiN)
# NOTE: if MLwiN not saved in location R2MLwiN defaults to, specify path via:
# options(MLwiN_path = 'path/to/MLwiN vX.XX/')
# If using R2MLwiN via WINE, the path may look like this:
# options(MLwiN_path = '/home/USERNAME/.wine/drive_c/Program Files (x86)/MLwiN vX.XX/')
## Example: tutorial
data(tutorial, package = "R2MLwiN")
(mymodel <- runMLwiN(normexam ~ 1 + standlrt + (1 + standlrt | school) + (1 | student),
estoptions = list(EstM = 1), data = tutorial))
##summary method
summary(mymodel)
##BDIC slot
mymodel@BDIC
## End(Not run)