Sunil W
2005-Dec-01 03:07 UTC
[R] Error in structural equation model - "The model has negative degrees 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. Thanks Sunil
John Fox
2005-Dec-01 13:59 UTC
[R] Error in structural equation model - "The model has negativedegrees of freedom"
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 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. > > Thanks > Sunil > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > R-project.org/posting-guide.html
Maybe Matching Threads
- Error in structural equation model - "The model has negativedegrees of freedom"
- FW: Error in structural equation model - "The model hasnegativedegrees of freedom"
- structural equation modeling in sem, error, The model has negative degrees of freedom = -3, and The model is almost surely misspecified...
- predictOMatic for regression. Please try and advise me
- sem package fails when no of factors increase from 3 to 4