Re: [R] sem error message
Hi, You did a really good job providing a reproducible example, except that you didn't mention which package sem() comes from. (sem, I'm assuming). I don't know how you came up with your covariance matrix, but it *isn't* symmetric: > isSymmetric(S.Seed.BB) [1] FALSE > S.Seed.BB[6, 2] [1] 37.758 > S.Seed.BB[2, 6] [1] 37.759 Sarah On Fri, May 4, 2012 at 10:36 AM, Vero Chillo wrote: > Hello, I tried to do a 'sem' analysis for data of how blueberry consumption > by birds is influenced by a pollution gradient, using distance and > vegetation structural and composition variables, but I got the following > error message: > > Error in sem.default(ram = ram, S = S, N = N, param.names = pars, var.names > = vars, : > S must be a square triangular or symmetric matrix > > This may be very obvious for R specialist, but I cant find the problem! > > #Symbolic ram model > mod.BB.1 <- specify.model() > BB.Cob -> B.B, lamb1, NA > Under.Cob -> B.B, lamb2, NA > BA -> B.B, lamb3, NA > Over.Comp -> B.B, lamb4, NA > Under.Comp -> B.B, lamb5, NA > Site -> B.B, lamb6, NA > Site -> BB.Cob, lamb7, NA > Site -> BA, lamb8, NA > Site -> Under.Cob, lamb9, NA > Site -> Under.Comp, lamb10, NA > Site -> Under.Comp, lamb11, NA > Under.Comp <-> Over.Comp, beta1, NA > Under.Cob <-> BA, beta2, NA > BB.Cob <-> BB.Cob, beta3, NA > Under.Cob <-> Under.Cob, beta4, NA > BA <-> BA, beta5, NA > Under.Comp <-> Under.Comp, beta6, NA > Over.Comp <-> Over.Comp, beta7, NA > B.B <-> B.B, beta8, NA > Site <-> Site, NA, 1 > > #S matrix > S.Seed.BB <- matrix(c( > 2.243, 3.055, 1.657, -2.166, 12.424, 27.105, 2.205, > 3.055, 41.942, 2.079, -2.392, 15.390, 37.759, 0.565, > 1.657, 2.079, 1.396, -1.655, 9.960, 15.360, -1.238, > -2.166, -2.392, -1.655, 2.164, -12.328, -25.099, -1.791, > 12.424, 15.390, 9.960, -12.328, 72.492, 129.491, -0.004, > 27.105, 37.758, 15.360, -25.099, 129.491, 456.913, 108.861, > 2.205, 0.565, -1.238, -1.791, -0.004, 108.861, 56.239),7,7,byrow=TRUE) > rownames(S.Seed.BB) <- colnames(S.Seed.BB) <- > c('Site','B.B','Over.Comp','Under.Comp','BA','Under.Cob', 'BB.Cob') > > #sem function > sem.BB.1 <- sem(mod.BB.1, S.Seed.BB, N=40) > > Thanks a lot for any suggestions! > -- Sarah Goslee http://www.functionaldiversity.org __ R-help@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.
[R] sem error message
Hello, I tried to do a 'sem' analysis for data of how blueberry consumption by birds is influenced by a pollution gradient, using distance and vegetation structural and composition variables, but I got the following error message: Error in sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : S must be a square triangular or symmetric matrix This may be very obvious for R specialist, but I cant find the problem! #Symbolic ram model mod.BB.1 <- specify.model() BB.Cob -> B.B, lamb1, NA Under.Cob -> B.B, lamb2, NA BA -> B.B, lamb3, NA Over.Comp -> B.B, lamb4, NA Under.Comp -> B.B, lamb5, NA Site -> B.B, lamb6, NA Site -> BB.Cob, lamb7, NA Site -> BA, lamb8, NA Site -> Under.Cob, lamb9, NA Site -> Under.Comp, lamb10, NA Site -> Under.Comp, lamb11, NA Under.Comp <-> Over.Comp, beta1, NA Under.Cob <-> BA, beta2, NA BB.Cob <-> BB.Cob, beta3, NA Under.Cob <-> Under.Cob, beta4, NA BA <-> BA, beta5, NA Under.Comp <-> Under.Comp, beta6, NA Over.Comp <-> Over.Comp, beta7, NA B.B <-> B.B, beta8, NA Site <-> Site, NA, 1 #S matrix S.Seed.BB <- matrix(c( 2.243, 3.055, 1.657, -2.166, 12.424, 27.105, 2.205, 3.055, 41.942, 2.079, -2.392, 15.390, 37.759, 0.565, 1.657, 2.079, 1.396, -1.655, 9.960, 15.360, -1.238, -2.166, -2.392, -1.655, 2.164, -12.328, -25.099, -1.791, 12.424, 15.390, 9.960, -12.328, 72.492, 129.491, -0.004, 27.105, 37.758, 15.360, -25.099, 129.491, 456.913, 108.861, 2.205, 0.565, -1.238, -1.791, -0.004, 108.861, 56.239),7,7,byrow=TRUE) rownames(S.Seed.BB) <- colnames(S.Seed.BB) <- c('Site','B.B','Over.Comp','Under.Comp','BA','Under.Cob', 'BB.Cob') #sem function sem.BB.1 <- sem(mod.BB.1, S.Seed.BB, N=40) Thanks a lot for any suggestions! - Biol. Verónica Chillo Grupo de Investigaciones de la Biodiversidad (GIB) Instituto Argentino de Investigaciones de Zonas Áridas (IADIZA) - CCT Mendoza, CONICET, Argentina Av. Ruíz Leal s/n, Parque San Martín, (CP5500) Mendoza Ciudad, Mendoza, Argentina. Tel. +54-261-5244130 http://personal.cricyt.edu.ar/vchillo/ -- View this message in context: http://r.789695.n4.nabble.com/sem-error-message-tp4608784.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] SEM error
Dear Kesinee, > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Kes > Sent: March-07-11 9:51 PM > To: r-help@r-project.org > Subject: [R] SEM error > > Dear All, > I am new for R and SEM. I try to fit the model with Y (ordinal outcome), > X > (4 categorical data), M1-M3 (continuous), and 2 covariates (Age&sex) as > a diagram. > library(polycor) > model.ly <-specify.model() > 1: x -> m1, gam11, NA > 2: x -> m2, gam12, NA > 3: x -> m3, gam13, NA > 4: age -> m1, gam14, NA > 5: age -> m2, gam15, NA > 6: age -> m3, gam16, NA > 7: sex -> m1, gam17, NA > 8: sex -> m2, gam18, NA > 9: sex -> m3, gam19, NA > 10: x -> y, gam20, NA > 11: m1 -> y, gam21, NA > 12: m2 -> y, gam22, NA > 13: m3 -> y, gam23, NA > 14: age -> y, gam24, NA > 15: sex -> y, gam25, NA, > 16: m1 <->m1, psi11, NA > 17: m2 <-> m2, psi12, NA > 18: m3 <-> m3, psi13, NA > 19: m1 <-> m2, psi21, NA > 20: m1 <->m3, psi22, NA > 21: m2 <-> m3, psi23, NA > 22: Y <-> Y, psi24, NA, > > hcor <-function(ly) hetcor(ly, std.err=FALSE)$correlations R.ly <- > hcor(ly) sem.ly <- sem(model.ly, R.ly, N=174) > > Error in sem.default(ram=ram, S=S, N=N,……) The model has > negative degree of freedom = -12 > > First, I do not know what the mistake is. Second, is this correctly > modeling my diagram? Any suggestions would be appreciated. First, if x isn't ordinal, you have to create dummy regressors to represent it. Second, your model has no variances or covariances for the exogenous variables (which you could handle compactly with the fixed.x argument to sem). Third, I notice that you use both y and Y in the model. Since Y probably doesn't exist in the input data, sem() treats it as a latent variable. This probably produces the negative df, though I don't know off hand why; had you spelled y correctly, the df should be positive, although, as I've mentioned, the model makes no sense. Finally, this model has a block-recursive structure, and an alternative would be to fit each equation in the model as an appropriate regression model. I hope this helps, John John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox > > Thank you, > Kesinee > http://r.789695.n4.nabble.com/file/n3340497/path.gif.png > > -- > View this message in context: http://r.789695.n4.nabble.com/SEM-error- > tp3340497p3340497.html > Sent from the R help mailing list archive at Nabble.com. > > __ > R-help@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. __ R-help@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.
[R] SEM error
Dear All, I am new for R and SEM. I try to fit the model with Y (ordinal outcome), X (4 categorical data), M1-M3 (continuous), and 2 covariates (Age&sex) as a diagram. library(polycor) model.ly <-specify.model() 1: x -> m1, gam11, NA 2: x -> m2, gam12, NA 3: x -> m3, gam13, NA 4: age -> m1, gam14, NA 5: age -> m2, gam15, NA 6: age -> m3, gam16, NA 7: sex -> m1, gam17, NA 8: sex -> m2, gam18, NA 9: sex -> m3, gam19, NA 10: x -> y, gam20, NA 11: m1 -> y, gam21, NA 12: m2 -> y, gam22, NA 13: m3 -> y, gam23, NA 14: age -> y, gam24, NA 15: sex -> y, gam25, NA, 16: m1 <->m1, psi11, NA 17: m2 <-> m2, psi12, NA 18: m3 <-> m3, psi13, NA 19: m1 <-> m2, psi21, NA 20: m1 <->m3, psi22, NA 21: m2 <-> m3, psi23, NA 22: Y <-> Y, psi24, NA, hcor <-function(ly) hetcor(ly, std.err=FALSE)$correlations R.ly <-hcor(ly) sem.ly <- sem(model.ly, R.ly, N=174) Error in sem.default(ram=ram, S=S, N=N,……) The model has negative degree of freedom = -12 First, I do not know what the mistake is. Second, is this correctly modeling my diagram? Any suggestions would be appreciated. Thank you, Kesinee http://r.789695.n4.nabble.com/file/n3340497/path.gif.png -- View this message in context: http://r.789695.n4.nabble.com/SEM-error-tp3340497p3340497.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] sem error "no variance or error-variance parameter"
Hi, many thanks for the help (i would swear I controlled the model specification like 15 times...). It runs correctly now! Best wishes, Jan Schubert Institute of Social Science Charles University, Prague -- View this message in context: http://r.789695.n4.nabble.com/sem-error-no-variance-or-error-variance-parameter-tp2221804p411.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] sem error "no variance or error-variance parameter"
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Jan Schubert > Sent: Tuesday, May 18, 2010 12:51 PM > To: r-help@r-project.org > Subject: [R] sem error "no variance or error-variance parameter" > > > Hi, > I am sorry to post the message again but I really need some advise on > that. > I am using the R version 2.11.0 and the version of sem package: > sem_0.9-20 > under Windows XP. > I read the questions: > http://r.789695.n4.nabble.com/computationally-singular-and-lack-of- > variance-parameters-in-SEM-td891081.html#a891082 > > and > > http://r.789695.n4.nabble.com/computationally-singular-and-lack-of- > variance-parameters-in-SEM-td891081.html#a891081 > > but it does not seem to be my problem. I try to replicate the sem model > (see > the attacheted image) but i got stuck with the problem while computing > the > estimates of the model: > The error message: > > Error in nlm(if (analytic.gradient) objective.2 else objective.1, > start, : > probable coding error in analytic gradient > In addition: Warning message: > In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = > vars, : > The following variables have no variance or error-variance parameter > (double-headed arrow): > Fugural1 > The model is almost surely misspecified; check also for missing > covariances. > > Here is my script: > > cov.matrix <- > matrix(c(56.21,0,0,0,0,0,0,0,0,31.55,75.55,0,0,0,0,0,0,0,23.27,28.30,44 > .45,0,0,0,0,0,0,24.48,32.24,22.56,84.64,0,0,0,0,0,22.51,29.54,20.61,57. > 61,78.93,0,0,0,0,22.65,27.56,15.33,53.57,49.27,73.76,0,0,0,33.24,46.49, > 31.44,67.81,54.76,54.58,141.77,0,0,32.56,40.37,25.58,55.82,55.33,47.74, > 98.62,117.33,0,30.32,40.44,27.69,54.78,53.44,59.52,96.95,84.87,106.35), > nrow=9,ncol=9,byrow=FALSE) > rownames(cov.matrix) <- colnames(cov.matrix) <- > c("IND1","IND2","IND3","FR11","FR12","FR13","FR21","FR22","FR23") > > # options(nlm=(check.analyticals = TRUE)); I tried to set the nlm on > different option, but did not work either > > m1 <- specify.model() > Induction -> IND1, NA, 1 > Induction -> IND2, y2, NA > Induction -> IND3, y3, NA > Fugural1 -> FR11, NA, 1 > Figural1 -> FR12, y5, NA > Figural1 -> FR13, y6, NA > Figural2 -> FR21, NA, 1 > Figural2 -> FR22, y8, NA > Figural2 -> FR23, y9, NA > Induction -> Figural1, x1, NA > Figural1 -> Figural2,x2, NA > Induction -> Figural2, x3, NA > IND1 <-> IND1, e1, NA > IND2 <-> IND2, e2, NA > IND3 <-> IND3, e3, NA > FR11 <-> FR11, e4, NA > FR12 <-> FR12, e5, NA > FR13 <-> FR13, e6, NA > FR21 <-> FR21,e7, NA > FR22 <-> FR22, e8, NA > FR23 <-> FR23, e9, NA > Figural1 <-> Figural1, e10, NA > Figural2 <-> Figural2, e11, NA > Induction <-> Induction, NA, 1 > > sem1 <- sem(m1,cov.matrix,N=220,debug=T) > > # I added the Induction <-> Induction, NA, 1 fixed parametr after > reading > the help from John Fox, that every variable should have an error > variance > > > Can anybody please advise me what I am doing wrong? > Many thanks! > > Jan Schubert > Institute of Social Science > Charles University, Prague > -- Jan, I didn't go through your model in detail, but if you look carefully at the error message, you appear to have misspelled Figural1 as Fugural1. When I corrected that problem, your example ran without error. Hope this is helpful, Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204 __ R-help@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.
[R] sem error "no variance or error-variance parameter"
Hi, I am sorry to post the message again but I really need some advise on that. I am using the R version 2.11.0 and the version of sem package: sem_0.9-20 under Windows XP. I read the questions: http://r.789695.n4.nabble.com/computationally-singular-and-lack-of-variance-parameters-in-SEM-td891081.html#a891082 and http://r.789695.n4.nabble.com/computationally-singular-and-lack-of-variance-parameters-in-SEM-td891081.html#a891081 but it does not seem to be my problem. I try to replicate the sem model (see the attacheted image) but i got stuck with the problem while computing the estimates of the model: The error message: Error in nlm(if (analytic.gradient) objective.2 else objective.1, start, : probable coding error in analytic gradient In addition: Warning message: In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : The following variables have no variance or error-variance parameter (double-headed arrow): Fugural1 The model is almost surely misspecified; check also for missing covariances. Here is my script: cov.matrix <- matrix(c(56.21,0,0,0,0,0,0,0,0,31.55,75.55,0,0,0,0,0,0,0,23.27,28.30,44.45,0,0,0,0,0,0,24.48,32.24,22.56,84.64,0,0,0,0,0,22.51,29.54,20.61,57.61,78.93,0,0,0,0,22.65,27.56,15.33,53.57,49.27,73.76,0,0,0,33.24,46.49,31.44,67.81,54.76,54.58,141.77,0,0,32.56,40.37,25.58,55.82,55.33,47.74,98.62,117.33,0,30.32,40.44,27.69,54.78,53.44,59.52,96.95,84.87,106.35),nrow=9,ncol=9,byrow=FALSE) rownames(cov.matrix) <- colnames(cov.matrix) <- c("IND1","IND2","IND3","FR11","FR12","FR13","FR21","FR22","FR23") # options(nlm=(check.analyticals = TRUE)); I tried to set the nlm on different option, but did not work either m1 <- specify.model() Induction -> IND1, NA, 1 Induction -> IND2, y2, NA Induction -> IND3, y3, NA Fugural1 -> FR11, NA, 1 Figural1 -> FR12, y5, NA Figural1 -> FR13, y6, NA Figural2 -> FR21, NA, 1 Figural2 -> FR22, y8, NA Figural2 -> FR23, y9, NA Induction -> Figural1, x1, NA Figural1 -> Figural2,x2, NA Induction -> Figural2, x3, NA IND1 <-> IND1, e1, NA IND2 <-> IND2, e2, NA IND3 <-> IND3, e3, NA FR11 <-> FR11, e4, NA FR12 <-> FR12, e5, NA FR13 <-> FR13, e6, NA FR21 <-> FR21,e7, NA FR22 <-> FR22, e8, NA FR23 <-> FR23, e9, NA Figural1 <-> Figural1, e10, NA Figural2 <-> Figural2, e11, NA Induction <-> Induction, NA, 1 sem1 <- sem(m1,cov.matrix,N=220,debug=T) # I added the Induction <-> Induction, NA, 1 fixed parametr after reading the help from John Fox, that every variable should have an error variance Can anybody please advise me what I am doing wrong? Many thanks! Jan Schubert Institute of Social Science Charles University, Prague -- View this message in context: http://r.789695.n4.nabble.com/sem-error-no-variance-or-error-variance-parameter-tp2221804p2221804.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] sem error "no variance or error-variance parameter"
Hi, I am using the R version 2.11.0 and the version of sem package: sem_0.9-20 under Windows XP. I read the questions: http://r.789695.n4.nabble.com/computationally-singular-and-lack-of-variance-parameters-in-SEM-td891081.html#a891082 and http://r.789695.n4.nabble.com/computationally-singular-and-lack-of-variance-parameters-in-SEM-td891081.html#a891081 but it does not seem to be my problem. I try to replicate the sem model (see the attacheted image) but i got stuck with the problem while computing the estimates of the model: The error message: Error in nlm(if (analytic.gradient) objective.2 else objective.1, start, : probable coding error in analytic gradient In addition: Warning message: In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : The following variables have no variance or error-variance parameter (double-headed arrow): Fugural1 The model is almost surely misspecified; check also for missing covariances. Here is my script: cov.matrix <- matrix(c(56.21,0,0,0,0,0,0,0,0,31.55,75.55,0,0,0,0,0,0,0,23.27,28.30,44.45,0,0,0,0,0,0,24.48,32.24,22.56,84.64,0,0,0,0,0,22.51,29.54,20.61,57.61,78.93,0,0,0,0,22.65,27.56,15.33,53.57,49.27,73.76,0,0,0,33.24,46.49,31.44,67.81,54.76,54.58,141.77,0,0,32.56,40.37,25.58,55.82,55.33,47.74,98.62,117.33,0,30.32,40.44,27.69,54.78,53.44,59.52,96.95,84.87,106.35),nrow=9,ncol=9,byrow=FALSE) rownames(cov.matrix) <- colnames(cov.matrix) <- c("IND1","IND2","IND3","FR11","FR12","FR13","FR21","FR22","FR23") # options(nlm=(check.analyticals = TRUE)); I tried to set the nlm on different option, but did not work either m1 <- specify.model() Induction -> IND1, NA, 1 Induction -> IND2, y2, NA Induction -> IND3, y3, NA Fugural1 -> FR11, NA, 1 Figural1 -> FR12, y5, NA Figural1 -> FR13, y6, NA Figural2 -> FR21, NA, 1 Figural2 -> FR22, y8, NA Figural2 -> FR23, y9, NA Induction -> Figural1, x1, NA Figural1 -> Figural2,x2, NA Induction -> Figural2, x3, NA IND1 <-> IND1, e1, NA IND2 <-> IND2, e2, NA IND3 <-> IND3, e3, NA FR11 <-> FR11, e4, NA FR12 <-> FR12, e5, NA FR13 <-> FR13, e6, NA FR21 <-> FR21,e7, NA FR22 <-> FR22, e8, NA FR23 <-> FR23, e9, NA Figural1 <-> Figural1, e10, NA Figural2 <-> Figural2, e11, NA Induction <-> Induction, NA, 1 sem1 <- sem(m1,cov.matrix,N=220,debug=T) # I added the Induction <-> Induction, NA, 1 fixed parametr after reading the help from John Fox, that every variable should have an error variance Can anybody please advise me what I am doing wrong? Many thanks! Jan Schubert Institute of Social Science Charles University, Prague -- View this message in context: http://r.789695.n4.nabble.com/sem-error-no-variance-or-error-variance-parameter-tp2196743p2196743.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] SEM error
Dear Jarret, Uwe, and Dan, Sorry -- I missed the initial question. What's a bit odd here is that the singularity occurs only in the computation of the modification indices. It might help to look at the conditioning of the covariance matrix of the parameter estimates (i.e., the eigenvalues or singular values), which must have been invertible. Regards, John On Mon, 22 Feb 2010 09:00:08 -0800 Jarrett Byrnes wrote: > I have often found this to happen if the scale of one variable is orders of > magnitude different than the scale of other variables. Have you tried > inspecting the covariance matrix and log transforming any such variables? > > On Feb 22, 2010, at 8:14 AM, Uwe Ligges wrote: > > > > > > > On 20.02.2010 08:51, Dan Edgcumbe wrote: > >> I'm trying to do some confirmatory factor analysis on some data. My > >> SEM > >> model solves in 22 iterations, but when I try to look at the > >> modification > >> indices, using mod.indices, I get the following error message: > >> > >> Error in solve.default(hessian) : > >> system is computationally singular: reciprocal condition number = > >> 4.40283e-18 > >> > >> What does this mean? > > > > That the method you apply tries to invert some object called > > "hessian" (maybe a hessian? ;-)) but fails since a singular matrix > > cannot be inverted. Perhaps (as I often found for people doing sem > > analyses) you have less observations than parameters to estimate or > > only certain combinations for some factors? > > > > Uwe Ligges > > > > > > > > > > > >> > >> Many thanks, > >> > >> Dan > >> > >>[[alternative HTML version deleted]] > >> > >> __ > >> R-help@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. > > > > __ > > R-help@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. > > __ > R-help@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. John Fox Sen. William McMaster Prof. of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/ __ R-help@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.
Re: [R] SEM error
I have often found this to happen if the scale of one variable is orders of magnitude different than the scale of other variables. Have you tried inspecting the covariance matrix and log transforming any such variables? On Feb 22, 2010, at 8:14 AM, Uwe Ligges wrote: On 20.02.2010 08:51, Dan Edgcumbe wrote: I'm trying to do some confirmatory factor analysis on some data. My SEM model solves in 22 iterations, but when I try to look at the modification indices, using mod.indices, I get the following error message: Error in solve.default(hessian) : system is computationally singular: reciprocal condition number = 4.40283e-18 What does this mean? That the method you apply tries to invert some object called "hessian" (maybe a hessian? ;-)) but fails since a singular matrix cannot be inverted. Perhaps (as I often found for people doing sem analyses) you have less observations than parameters to estimate or only certain combinations for some factors? Uwe Ligges Many thanks, Dan [[alternative HTML version deleted]] __ R-help@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. __ R-help@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. __ R-help@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.
Re: [R] SEM error
On 20.02.2010 08:51, Dan Edgcumbe wrote: I'm trying to do some confirmatory factor analysis on some data. My SEM model solves in 22 iterations, but when I try to look at the modification indices, using mod.indices, I get the following error message: Error in solve.default(hessian) : system is computationally singular: reciprocal condition number = 4.40283e-18 What does this mean? That the method you apply tries to invert some object called "hessian" (maybe a hessian? ;-)) but fails since a singular matrix cannot be inverted. Perhaps (as I often found for people doing sem analyses) you have less observations than parameters to estimate or only certain combinations for some factors? Uwe Ligges Many thanks, Dan [[alternative HTML version deleted]] __ R-help@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. __ R-help@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.
[R] SEM error
I'm trying to do some confirmatory factor analysis on some data. My SEM model solves in 22 iterations, but when I try to look at the modification indices, using mod.indices, I get the following error message: Error in solve.default(hessian) : system is computationally singular: reciprocal condition number = 4.40283e-18 What does this mean? Many thanks, Dan [[alternative HTML version deleted]] __ R-help@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.