You are here

Confidence Interval(CI)

3 posts / 0 new
Last post
Salutfate's picture
Offline
Joined: 11/22/2013 - 04:34
Confidence Interval(CI)

Hello everyone!

During the process of getting the result of my twin submodel, I failed to get the CI. For example, in the AE model, I get the a2, e2, but how to show the CI? Of course, I get the CI in the full model ACE. The scripts of submodel are below, should I add something?

Run AE model

AeModel <- mxModel( AdceFit, name="AE" )
AeModel <- omxSetParameters( AeModel, labels="d11", free=FALSE, values=0 )
AeModel <- omxSetParameters( AeModel, labels="c11", free=FALSE, values=0 )
AeFit <- mxRun(AeModel)
mxCompare(AdceFit, AeFit)
round(AeFit@output$estimate,4)
round(AeFit$Vars@result,4)

Thanks in advance.

mhunter's picture
Offline
Joined: 07/31/2009 - 15:26
?mxCI

To get the confidence intervals on parameters labeled "YourConfParam1" and "YourConfParam2" you'd need to add something like the following.

AeConf <- mxCI(c( "YourConfParam1", "YourConfParam2"))
AeModel <- mxModel( AdceFit, AeConf, name="AE" )
AeFitWithCI <- mxRun(AeModel, intervals=TRUE) #Expect this to take longer to run
summary(AeFitWithCI)$CI #Look at CIs

Hope this helps!

Salutfate's picture
Offline
Joined: 11/22/2013 - 04:34
Thanks

Thanks, mhunter. Sorry to reply so late. This is really of great help to me. Thanks a lot.