I have been trying to use lavaan (version 0.4-7) for a simple path model,
but the program seems to be computing far less degrees of freedom for my
model then it should have.  I have 7 variables, which should give (7)(8)/2 =
28 covariances, and hence 28 DF.  The model seems to only think I have 13
DF.  The code to reproduce the problem is below.  Have I done something
wrong, or is this something I should take to the developer?


library(lavaan)

myCov = matrix(c(24.40, 0, 0, 0, 0, 0, 0, .03, .03, 0, 0, 0, 0, 0, 6.75, -
.08, 519.38, 0, 0, 0, 0, .36, .01, 2.74, .18, 0, 0, 0, .51, .0, -.31, .02,
.2, .0, 0, -.17, .0, -1.6, -.04, .01, .25, 0, -.1, .02, -.03, .0, -.01, .01
, .02), nrow=7, byrow=TRUE, dimnames=list(c("Internet", "Stress3",
"HHincome", "Race", "Age", "Gender", "Stress1"), c("Internet", "Stress3",
"HHincome", "Race", "Age", "Gender", "Stress1")))


model = '

Internet ~ HHincome + Race + Age + Gender + Stress1

Stress3 ~ Internet + HHincome + Race + Age + Gender + Stress1

'


fit=sem(model, sample.nobs=161, sample.cov=myCov, mimic.Mplus=FALSE)


#check the number of parameters being estimated

inspect(fit, what="free")


#Note the DF for the Chi-square is 0, when it should be 28-13 = 15

summary(fit)


Andrew Miles

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to