[R] Help with SEM package: Error message

John Fox jfox at mcmaster.ca
Tue Nov 8 21:32:18 CET 2011


Dear Lisa,

There doesn't seem to be anything logically wrong with your model.

I don't have much time today to look into it, but trying different optimizers in version 2.0-0 of sem, using the correlation matrix in place of the covariance matrix, and setting the par.size parameter, I was unable to obtain an admissible solution. I also was unable using factanal() to fit an exploratory factor analysis for five factors to your data. I expect that the problem is ill-conditioned.

Best,
 John

------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/
On Tue, 8 Nov 2011 08:18:28 -0800 (PST)
 lisamp85 <lisamlpham at gmail.com> wrote:
> Hello.  
> 
> I started using the sem package in R and after a lot of searching and trying
> things I am still having difficulty.  I get the following error message when
> I use the sem() function:
> 
> Warning message:
> In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names =
> vars,  :
>   Could not compute QR decomposition of Hessian.
> Optimization probably did not converge.
> 
> I started with a simple example using the specify.model() function, but it
> is really straight forward.  I uploaded my specify.model script and my data
> covariance matrix here too so I wouldn't clutter this email with the entire
> model (20 observed variables, 5 factors).  Could this error message be from
> the data itself and not from my path model?
> 
> I have my observed variables X and my unobserved variables F.  I have ONLY
> exogenous latent variables (i.e. they never appear on the right side of the
> single head arrow ->).  I include all possible factor covariances FjFk, and
> the only constraints I've made was to restrict the Factor variances to 1.
> My model follows in this basic format (as you can see from my uploaded
> file):
> 
> # Factors (where I specify which observed variables load on to which
> factors)
> # I have only exogenous latent variables
> F.i -> X.j, lamj.i, NA
> .
> .
> .
> # Observed variable variances
> X.j <-> X.j, ej, NA
> .
> .
> .
> # Factor variances (I fixed all factor variances to 1)
> F.i <-> F.i, NA, 1
> .
> .
> .
> # Factor covariances (I represent all factor covariances, i.e. the upper or
> lower triangle of a covariance matrix)
> F.i <-> F.k, FiFk, NA
> .
> .
> .
> 
> Did I do something wrong here?  
> Here are my uploaded files:
> CFA script:  http://r.789695.n4.nabble.com/file/n4016569/CFA_script.txt
> CFA_script.txt 
> Covariance matrix: 
> http://r.789695.n4.nabble.com/file/n4016569/covariance_matrix.RData
> covariance_matrix.RData 
> 
> 
> Thank you so much for any and all of your help.
> Lisa
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Help-with-SEM-package-Error-message-tp4016569p4016569.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list