[R] sem error "no variance or error-variance parameter"

Jan Schubert honza.schubert at gmail.com
Tue May 18 21:50:41 CEST 2010

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:



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):
The model is almost surely misspecified; check also for missing covariances.

Here is my script:

cov.matrix <-
rownames(cov.matrix) <- colnames(cov.matrix) <-

# 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.

More information about the R-help mailing list