Thursday, September 5, 2013

Some notes on R-package 'lavaan'


The cfa function is a (convenience) wrapper for the lavaan function. For beginners, it's best to use the cfa function.

FIML estimation is not available for binary / ordered / categorical data. However, version 0.5-14 allows for pairwise deletion (used to be only listwise, prior to 0.5-14) when using WLS estimation.

The model is specified by assigning a character string:
model <- ' model specification '

The model specification consists of statements like:

Latent variable 'Factor 1' is measured by observed variables 'x1', 'x2', and 'x3':
factor1 =~ x1 + x2 + x3

Observed variables 'x1' and 'x2' have a residual covariance:
x1 ~~ x2

Observed variable 'x1' has a residual variance:
x1 ~~

Variable 1 (dep var; may be observed or latent) 'v1' is regressed on variable 2 (indep var; may be observed or latent) and variable 3 (indep var; may be observed or latent):
v1 ~ v2 + v3

Variable 1 (may be observed or latent) has an intercept ('1'), that should be fixed to zero:
v1 ~ 1*0

The first threshold of variable 1 should be fixed to zero:
v1 | 0 * t1








No comments:

Post a Comment