Attachment | Size |
---|---|
forum_revised_code_example.txt | 1.68 KB |
I am trying to allow for correlation between some residual errors in a single common factor model with 7 methods. I want them to all equal a common correlation rho. The attached file shows how I coded the mxPath and mxAlgebra statements to link the covariances so that the covariance equals the product of the two standard deviations and the common correlation rho. When I run this using mxRun or mxTryHard:
fit.all.cov.deep2 <- mxRun(model.all.cov.deep2)
Error: Unknown reference 'rho' detected in the entity 'cov23' in model 'model_all_cov_deep2'
How can I fix this?
As I'm thinking about this model, a bigger question is, Is it identified? Going through the rules, I think I need at least two indicators that have erres that are not correlated. But I still need to understand how to code this model.
For identification of many models see
?mxCheckIdentification
. This checks for local model identification, so it depends on the current values of the free parameters. The help page for that function has several further details. If you're using an ML function without definition variables ormxConstraint
, then it should work. In the case that the model is not identified it will tell you which free parameters are not identified.Any ideas of why the code does not work?
OK, this was answered in another thread. I have to define rho using an mxMatrix statement. So I will add this and use mxCheckIdentification. Thanks.