[R] sem is not "taking" the model
John Fox
jfox at mcmaster.ca
Wed Apr 11 23:20:11 CEST 2007
Dear Dimitri,
This works find for me. It's not possible to know what you did wrong
without more information, but one guess (probably wrong) is that you
didn't enter a blank line to exit from specify.model(), which simply
uses scan() to read the model:
> library(sem)
> model1 <- specify.model()
1: NECESSITY -> n1, NA, 1
2: NECESSITY -> n2, lam_nec_2, NA
3: NECESSITY -> n3, lam_nec_3, NA
4: NECESSITY -> n4, lam_nec_4, NA
5: FRUGALITY -> f1, NA, 1
6: FRUGALITY -> f2, lam_frug_2, NA
7: FRUGALITY -> f3, lam_frug_3, NA
8: TIME -> t1, NA, 1
9: n1 <-> n1, theta_n1, NA
10: n2 <-> n2, theta_n2, NA
11: n3 <-> n3, theta_n3, NA
12: n4 <-> n4, theta_n4, NA
13: f1 <-> f1, theta_f1, NA
14: f2 <-> f2, theta_f2, NA
15: f3 <-> f3, theta_f3, NA
16: t1 <-> t1, NA, 0.414
17: NECESSITY <-> NECESSITY, phi_NN, NA
18: FRUGALITY <-> FRUGALITY, phi_FF, NA
19: TIME <-> TIME, phi_TT, NA
20: NECESSITY <-> TIME, phi_NT, NA
21: NECESSITY <-> FRUGALITY, phi_NF, NA
22: FRUGALITY <-> TIME, phi_FT, NA
23:
Read 22 records
>
Regards,
John
On Wed, 11 Apr 2007 11:41:25 -0700 (PDT)
John Smith <ld7631 at yahoo.com> wrote:
> A strange problem with sem:
>
> I downloaded the sem library and then, I specified my simple
> measurement model (below). I highlighted it and ran it. It ran, but
> it did NOT tell me "22 lines read". And nothing works after that - it
> looks like it runs, but it does not produce anything...
> Did I make a mistake somewhere in the model? (notice, TIME has only 1
> indicator - t1, and I fixed t1's error variance at 0.414.)
> Thank you!
>
> model1 <- specify.model()
> NECESSITY -> n1, NA, 1
> NECESSITY -> n2, lam_nec_2, NA
> NECESSITY -> n3, lam_nec_3, NA
> NECESSITY -> n4, lam_nec_4, NA
> FRUGALITY -> f1, NA, 1
> FRUGALITY -> f2, lam_frug_2, NA
> FRUGALITY -> f3, lam_frug_3, NA
> TIME -> t1, NA, 1
> n1 <-> n1, theta_n1, NA
> n2 <-> n2, theta_n2, NA
> n3 <-> n3, theta_n3, NA
> n4 <-> n4, theta_n4, NA
> f1 <-> f1, theta_f1, NA
> f2 <-> f2, theta_f2, NA
> f3 <-> f3, theta_f3, NA
> t1 <-> t1, NA, 0.414
> NECESSITY <-> NECESSITY, phi_NN, NA
> FRUGALITY <-> FRUGALITY, phi_FF, NA
> TIME <-> TIME, phi_TT, NA
> NECESSITY <-> TIME, phi_NT, NA
> NECESSITY <-> FRUGALITY, phi_NF, NA
> FRUGALITY <-> TIME, phi_FT, NA
>
>
>
>
____________________________________________________________________________________
> Finding fabulous fares is fun.
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/
More information about the R-help
mailing list