Hi metaSEM users, hi Mike,
I enjoy using the metaSEM package for my analysis in R. I amjust wondering how I can compare path cofficients in an estimated model (t-test) ? Probably it is quite easy, but I am new to R. So help is really appreciated :)
Thanks
Johannes
Hi Johannes,
You may use the same label if you want to have the same parameter estimates. Then you can compare the models by using the anova() function. For example,
fixed1 <- tssem1(Becker94$data, Becker94$n, method="FEM")
summary(fixed1)
Different regression coefficients
A1 <- create.mxMatrix(c(0,"0.2Spatial2Aptitude","0.2Verbal2Aptitude",
0,0,0,
0,0,0), type="Full",
ncol=3, nrow=3, byrow=TRUE, name="A1")
S1 <- create.mxMatrix(c("0.2ErrorVarAptitude",
0,1,
0,"0.2CorBetweenSpatialVerbal",1),
type="Symm", byrow=TRUE, name="S1")
fixed2a <- tssem2(fixed1, Amatrix=A1, Smatrix=S1,
model.name="Different regression cofficients")
summary(fixed2a)
Same regression coefficient
A2 <- create.mxMatrix(c(0,"0.2Aptitude","0.2Aptitude",
0,0,0,
0,0,0), type="Full",
ncol=3, nrow=3, byrow=TRUE, name="A1")
fixed2b <- tssem2(fixed1, Amatrix=A2, Smatrix=S1,
model.name="Same regression cofficient")
summary(fixed2b)
Compare these two models with a chi-square difference test
anova(fixed2a, fixed2b)
Mike
Hi Mike,
Thanks for your quick answer. Then I will try the model comparisons. I thought there might be something like the test in MPlus that tests c1 = c2 within a model.
Johannes
Interestingly, it works but I am not really sure with the results.
When I compare the models with the coefficients of .124*** and -.037 (differnt vs. same), they are not significantly different. Can that be?