[R] SEM eigen value error 0 X 0 matrix

jahughes81 jessica.hughes at acl.psych.toronto.edu
Mon Mar 12 03:20:45 CET 2012


Using R-studio, I am trying to run a structural equation model and I am
running into problems with testing my primary model. Once I specify
everything and try to run it I get this error:

Error in eigen(S, symmetric = TRUE, only.values = TRUE) : 0 x 0 matrix

And when I look at the object for my primary model in my workspace, which is
created after I specify it, it lists all my model components, but has a
whole bunch of 'NA' values listed after my components. I have no idea why
they are listed there because I omitted all of the 'NA' values from my data
and can verify this by a visual inspection.

Here is my specified model:

# Primary model

wellbeing.model <- specifyModel()
belonging -> optimism, path1
autonomy -> optimism, path2
optimism -> wellbeing, path3
belonging -> belonging_hapmar, patha
belonging -> belonging_attend, pathb
belonging -> belonging_cowrkint, pathc
autonomy -> autonomy_overwork, pathd
autonomy -> autonomy_famwkoff, pathe
autonomy -> autonomy_hrsrelax, pathf
optimism -> optimism_confinan, pathg
optimism -> optimism_goodlife, pathh
optimism -> optimis_conlegis, pathi
wellbeing -> wellbeing_happy, pathj
wellbeing -> wellbeing_health, pathk
wellbeing -> wellbeing_life, pathl
belonging <-> autonomy, covariance1
autonomy_overwork <-> autonomy_famwkoff, covariance2
autonomy_overwork <-> autonomy_hrsrelax, covariance3
autonomy_hrsrelax <-> autonomy_famwkoff, covariance4
belonging <-> belonging, variance1
autonomy <-> autonomy, variance2
optimism <-> optimism, disturbance1
optimism_confinan <-> optimism_goodlife, disturbance2
optimism_goodlife <-> optimism_conlegis, disturbance3
optimism_confinan <-> optimism_conlegis, disturbance4
wellbeing <-> wellbeing, disturbance5
wellbeing_happy <-> wellbeing_health, disturbance6
wellbeing_happy <-> wellbeing_life, disturbance7
wellbeing_health <-> wellbeing_life, disturbance8
wellbeing.analysis <- sem( wellbeing.model, gss.data.cov, nrow(gss.data_C) )
summary( wellbeing.analysis )
stdCoef( wellbeing.analysis )
effects( wellbeing.analysis )
pathDiagram( wellbeing.analysis, "WellbeingPathModel", standardize=TRUE,
edge.labels="values" )

And here are my model components once specified:

structure(c("belonging -> optimism", "autonomy -> optimism", 
"optimism -> wellbeing", "belonging -> belonging_hapmar", "belonging ->
belonging_attend", 
"belonging -> belonging_cowrkint", "autonomy -> autonomy_overwork", 
"autonomy -> autonomy_famwkoff", "autonomy -> autonomy_hrsrelax", 
"optimism -> optimism_confinan", "optimism -> optimism_goodlife", 
"optimism -> optimis_conlegis", "wellbeing -> wellbeing_happy", 
"wellbeing -> wellbeing_health", "wellbeing -> wellbeing_life", 
"belonging <-> autonomy", "autonomy_overwork <-> autonomy_famwkoff", 
"autonomy_overwork <-> autonomy_hrsrelax", "autonomy_hrsrelax <->
autonomy_famwkoff", 
"belonging <-> belonging", "autonomy <-> autonomy", "optimism <-> optimism", 
"optimism_confinan <-> optimism_goodlife", "optimism_goodlife <->
optimism_conlegis", 
"optimism_confinan <-> optimism_conlegis", "wellbeing <-> wellbeing", 
"wellbeing_happy <-> wellbeing_health", "wellbeing_happy <->
wellbeing_life", 
"wellbeing_health <-> wellbeing_life", "belonging_hapmar <->
belonging_hapmar", 
"belonging_attend <-> belonging_attend", "belonging_cowrkint <->
belonging_cowrkint", 
"autonomy_overwork <-> autonomy_overwork", "autonomy_famwkoff <->
autonomy_famwkoff", 
"autonomy_hrsrelax <-> autonomy_hrsrelax", "optimism_confinan <->
optimism_confinan", 
"optimism_goodlife <-> optimism_goodlife", "optimis_conlegis <->
optimis_conlegis", 
"wellbeing_happy <-> wellbeing_happy", "wellbeing_health <->
wellbeing_health", 
"wellbeing_life <-> wellbeing_life", "path1", "path2", "path3", 
"patha", "pathb", "pathc", "pathd", "pathe", "pathf", "pathg", 
"pathh", "pathi", "pathj", "pathk", "pathl", "covariance1", "covariance2", 
"covariance3", "covariance4", "variance1", "variance2", "disturbance1", 
"disturbance2", "disturbance3", "disturbance4", "disturbance5", 
"disturbance6", "disturbance7", "disturbance8", "V[belonging_hapmar]", 
"V[belonging_attend]", "V[belonging_cowrkint]", "V[autonomy_overwork]", 
"V[autonomy_famwkoff]", "V[autonomy_hrsrelax]", "V[optimism_confinan]", 
"V[optimism_goodlife]", "V[optimis_conlegis]", "V[wellbeing_happy]", 
"V[wellbeing_health]", "V[wellbeing_life]", NA, NA, NA, NA, NA, 
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 
NA, NA, NA, NA), .Dim = c(41L, 3L), class = "semmod")

I have no idea where the 'NA' values are coming from.

Any help would be most appreciated!

-
Jessica

--
View this message in context: http://r.789695.n4.nabble.com/SEM-eigen-value-error-0-X-0-matrix-tp4465139p4465139.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list