View source: R/randomIntModel.R
randomIntModel | R Documentation |
This provides code that should run a pretty agnostic 'random intercept model' in
lavaan
, in much the manner detailed by Mehta & Neale (2005, Figure 3).
randomIntModel(pmRatingData[3:ncol(pmRatingData)]) #if first two variables
are 'p' and 'm' and all the remaining variables are variable ratings
varset |
the set of variables you want to include in the null model |
Unfortunately, there is a good chance that if you have a large number of variables (or perhaps a large number of clusters, or observations within clusters, or... I don't know the parameters), that this will take basically forever to run. Unfortunately I don't have any ideas about what causes this or how to fix it.
the text you need to put into model
for lavaan::sem(model, ...)
.
Note that original variables x
will be relabeled wx
and and bx
to
indicate within- and between- levels, respectively.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.