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.