I am new to R. 
I just tried to recreate in R (using sem package and the identical input data) a solution for a simple measurment model I have found before in LISREL. LISREL had no problems and converged in just 3 iterations. 
In sem, I got no solution, just the warning message:

"Could not compute QR decomposition of Hessian.
Optimization probably did not converge.
 in: sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, "

What does it mean? Maybe I am doing something wrong?

I have 3 latent factors (Anxiety, Depression, and Fear) - each of them has 3 observed indicators (a1, a2, a3; d1, d2, d3, and f1, f2, f3)
Below is my script in R:

! ANALYSIS OF ANXIETY, DEPRESSION, AND FEAR - LISREL P.31

! Creating the ANXIETY, DEPRESSION, AND FEAR intercorrelation matrix (KM):
KM<-matrix(
c(1,.8,.83,.2,.21,.19,.18,.18,.18,
0,1,.81,.22,.24,.18,.19,.19,.21,
0,0,1,.22,.19,.2,.2,.2,.22,
0,0,0,1,.84,.82,.22,.22,.21,
0,0,0,0,1,.84,.19,.18,.19,
0,0,0,0,0,1,.18,.18,.18,
0,0,0,0,0,0,1,.84,.82,
0,0,0,0,0,0,0,1,.81,
0,0,0,0,0,0,0,0,1), 9, 9)

! Creating the ANXIETY, DEPRESSION, AND FEAR Standard Deviations vector (SD):
SD<-c(1.5, 2.4, 3.2, 2.3, 2.3, 2.6, 4.5, 4.7, 5.6)

! Calculating the Var-Covar matrix based on correlations and SDs:
library(MASS)
COVAR<-outer(SD, SD) * KM

! Creating variable names
rownames(COVAR)<-colnames(COVAR)<-c('a1','a2','a3','d1','d2','d3','f1','f2','f3')

! Specifying the measurement model to estimate:
model<-specify.model()
ANXIETY -> a1,     NA, 1
ANXIETY -> a2,     lam_anx_2, NA 
ANXIETY -> a3,     lam_anx_3, NA
DEPRESS -> d1,     NA, 1
DEPRESS -> d2,     lam_dep_2, NA
DEPRESS -> d3,     lam_dep_3, NA
FEAR -> f1,             NA, 1
FEAR -> f2,             lam_fear_2, NA
FEAR -> f3,             lam_fear_3, NA
a1 <-> a1,                theta_a1, NA
a2 <-> a2,                theta_a2, NA
a3 <-> a3,                theta_a3, NA
d1 <-> d1,               theta_d1, NA
d2 <-> d2,               theta_d2, NA
d3 <-> d3,               theta_d3, NA
f1 <-> f1,                 theta_f1, NA
f2 <-> f2,                 theta_f2, NA
f3 <-> f3,                 theta_f3, NA
ANXIETY <-> ANXIETY,   phi_AA, NA
DEPRESS <-> DEPRESS,     phi_DD, NA
FEAR <-> FEAR,                  phi_FF, NA
ANXIETY <-> FEAR,           phi_AF, NA
ANXIETY <-> DEPRESS,    phi_AD, NA
DEPRESS <-> FEAR,            phi_DF, NA

! Running the estimation using sem:
sem.anxiety<-sem(model, COVAR, N=150)

Thank you very much for your advice!
Dimitri


 
____________________________________________________________________________________



	[[alternative HTML version deleted]]

