Hello All,
Based on the generic script (below) from the OpenMx webpage I'm testing a very simple sub-model in which I drop one element of the 'S' matrix to zero and then compare back to the full model. I get an error message which says "Error in parameters[[i]] : subscript out of bounds". Does anyone have an idea as to why this might be happening?
Cheers,
Nathan
require(OpenMx)
data(demoOneFactor)
manifests <- names(demoOneFactor)
latents <- c("G")
factorModel <- mxModel("One Factor", type="RAM",
manifestVars = manifests,
latentVars = latents,
mxPath(from=latents, to=manifests),
mxPath(from=manifests, arrows=2),
mxPath(from=latents, arrows=2,
free=F, values=1.0),
mxData(cov(demoOneFactor), type="cov",
numObs=500))
summary(mxRun(factorModel))
factorModelFit <- mxRun(factorModel) # Run model
factorModelFitSumm <- summary(factorModelFit)
Drop element [5,5] to 0 in S matrix
factorModelFit@matrices$S@free[5,5] <- F
factorModelFit@matrices$S@values [5,5] <- 0
sub1 <-mxRun(factorModelFit)
Compare Full and Nested models
tableFitStatistics(factorModelFit,sub1)