[R] FW: Error in structural equation model - "The model hasnegativedegrees of freedom"
John Fox
jfox at mcmaster.ca
Sun Dec 4 23:08:28 CET 2005
Dear R-help list members,
I forgot to copy my reply to the r-help list. Here's most of it.
John
--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox
--------------------------------
-----Original Message-----
From: John Fox [mailto:jfox at mcmaster.ca]
Sent: Sunday, December 04, 2005 5:01 PM
To: 'Sunil W'
Subject: RE: [R] Error in structural equation model - "The model
hasnegativedegrees of freedom"
Dear Sunil,
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Sunil W
> Sent: Sunday, December 04, 2005 11:03 AM
> To: R-help at stat.math.ethz.ch
> Subject: [R] Error in structural equation model - "The model
> hasnegativedegrees of freedom"
>
> Hi John
> Thanks a lot for the reply.
>
> Could you suggest how I can correct this problem? I tried using a
> correlation matrix instead of raw moments, but still got the same
> error. I also fixed parameters v1,v2,v3,a1 at 1; then it gave me the
> error that the system is exatly singular.
>
The model is underidentified regardless of the input matrix. My point was
that if you're using raw moments (as opposed to covariances or correlations)
you should have a constant term in each equation.
> To answer the points that you raised:
>
> 1. x1-x6 are not causes; they are just indicatiors. Does that change
> my model?
>
Yes. The arrows should go the other way.
> 2. Is the size of the dataset going to be a real limitation?
> How can I take care of that?
>
. . .
> -----------------------------------
> Dear Sunil,
>
> There are 7*8/2 = 28 raw moments among the 7 observed variables. Of
> these,
> 6*7/2 = 21 are used for the moments among the 6 fixed-exogenous
> variables, leaving 28 - 21 = 7 df. You model has 11 free parameters.
> So df for the model = 11 - 7 = -4.
>
> Some additional comments:
>
> If you're using raw moments, why isn't there a constant variable in
> the model?
>
> Do you really intend x1 -- x6 to be causes, rather than indicators, of
> m1 and m2?
>
> Why are there no normalizing constraints on the latent variables?
>
> Do you really want to fit a model like this to so small a data set?
>
> I hope this helps,
> John
>
> John Fox
> Department of Sociology
> McMaster University
> Hamilton, Ontario
> Canada L8S 4M4
> 905-525-9140x23604
> http://socserv.mcmaster.ca/jfox
>
> >-----Original Message-----
> >From: r-help-bounces at stat.math.ethz.ch
> >[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Sunil W
> >Sent: Wednesday, November 30, 2005 10:08 PM
> >To: r-help at stat.math.ethz.ch
> >Subject: [R] Error in structural equation model - "The model has
> >negativedegrees of freedom"
> >
> >Hi
> >
> >I am running a structural equation model with R using the
> sem command;
> >am getting the following error:
> >
> >"Error in sem.default : The model has negative degrees of
> freedom = -4"
> >
> >
> >My model is as follows:
> >
> >s_model = specify.model()
> >x1->m1, b1,NA
> >x2->m1, b2,NA
> >x3->m2, b3,NA
> >x4->m2, b4,NA
> >x5->m2, b5,NA
> >x6->m2, b6,NA
> >m1->y, a1,NA
> >m2->y, a2,NA
> >m1<->m1, v1,NA
> >m2<->m2, v2,NA
> >y<->y, v3,NA
> >
> >
> >x1-x6 are observed independent variables, m1 and m2 are the latent
> >variables and y is the observed dependent variable. I use the
> >raw.moments command for calculating the covariance matrix,
> based on a
> >data with 147 observations.
> >
> >The command that I use is as follows:
> >
> >s = sem(s_model,S=R,obs.variables=colnames(R),
> >fixed.x=c('x1','x2','x3','x4','x5','x6'), raw=TRUE)
> >
> >
> >I would appreciate any help on this; I am new to structural equation
> >models and realize that I may be making a silly error.
> >
>
More information about the R-help
mailing list