[R] SEM - singularity error
nicolette.cagle at duke.edu
nicolette.cagle at duke.edu
Thu Sep 20 15:08:47 CEST 2007
Good morning,
I am trying to develop a structural equation model of snake abundance using
habitat variables. In attempting to estimate the model using the "sem" package
in R version 2.4.0, I receive the following error message:
"Error in solve.default(C) : system is computationally singular: reciprocal
condition number = 1.75349e-16"
MAIN PROBLEM: I am hoping to discover why I am receiving the aforementioned
error message and how to successfully estimate the model.
OTHER INFORMATION:
1. I believe the model is over-identified rather than under-identified (based on
my understanding of the t-rule). I have observed data for 10 variables (9
exogenous, 1 endogenous).
2. I am not certain that I have used the proper tool to estimate the covariance
matrix. In this case, I used the "VAR" function.
3. I am most concerned that I have improperly coded the RAM file. For example,
in a case where I have three exogenous indicators of one exogenous latent
variable, I specify a start value of 1 for one of the exogenous indicators. I
am not sure if this is proper or necessary.
4. I am new to SEM; this is the first model I have ever tried to estimate.
R CODE: Below is the r-code I have used to estimate the structural equation
model --
# LOADING R PACKAGES
library(sem)
# READING IN THE CSV FILES
thsi.2006<-read.csv("thsi_ab_env_space_sem.csv")
thsi<-thsi.2006
# MAKING "RAM" FILE 2
model2.nlc <-specify.model()
Moist->slope, NA, 1
Moist->sand, lamda21, NA
Moist->clay, lamda31, NA
Hab->isol, NA, 1
Hab->edgedist_a, lamda52, NA
Hab->ag10, lamda62, NA
Hab->urb10, lamda72, NA
Hab->rd10, lamda82, NA
Hab->y, lamda92, NA
Moist->this, gamma11, NA
Hab->this, gamma12, NA
slope<->slope, theta11, NA
sand<->sand, theta22, NA
clay<->clay, theta33, NA
isol<->isol, theta44, NA
edgedist_a<->edgedist_a, theta55, NA
ag10<->ag10, theta66, NA
urb10<->urb10, theta77, NA
rd10<->rd10, theta88, NA
y<->y, the99, NA
Moist<->Moist, phi11, NA
Hab<->Hab, phi22, NA
this<->this, theps11, NA
model2.nlc
end
# MAKING S (COVARIANCE MATRIX)
thsi.var <- var(thsi)
# MAKING UNSCALED SEM MODEL
sem2<-sem(ram=model2.nlc, S=thsi.var, N=22)
I am also attaching a jpeg diagram of the model I am trying to estimate. Please
let me know if there is any additional information that I should add to this
posting.
Thank you so much for your time.
Nicolette Cagle
--
Ecology Ph.D. Candidate
Duke University
Durham, NC 27708
www.duke.edu/~nlc4
More information about the R-help
mailing list