[R] sem error message

Vero Chillo vchillo at gmail.com
Fri May 4 16:36:36 CEST 2012


Hello, I tried to do a 'sem' analysis for data of how blueberry consumption
by birds is influenced by a pollution gradient, using distance and
vegetation structural and composition variables, but I got the following
error message:

Error in sem.default(ram = ram, S = S, N = N, param.names = pars, var.names
= vars,  : 
  S must be a square triangular or symmetric matrix

This may be very obvious for R specialist, but I cant find the problem!

#Symbolic ram model 
mod.BB.1 <- specify.model()
BB.Cob -> B.B, lamb1, NA
Under.Cob -> B.B, lamb2, NA
BA -> B.B, lamb3, NA
Over.Comp -> B.B, lamb4, NA
Under.Comp -> B.B, lamb5, NA
Site -> B.B, lamb6, NA
Site -> BB.Cob, lamb7, NA
Site -> BA, lamb8, NA
Site -> Under.Cob, lamb9, NA
Site -> Under.Comp, lamb10, NA
Site -> Under.Comp, lamb11, NA
Under.Comp <-> Over.Comp, beta1, NA
Under.Cob <-> BA, beta2, NA
BB.Cob <-> BB.Cob, beta3, NA
Under.Cob <-> Under.Cob, beta4, NA
BA <-> BA, beta5, NA
Under.Comp <-> Under.Comp, beta6, NA
Over.Comp <-> Over.Comp, beta7, NA
B.B <-> B.B, beta8, NA
Site <-> Site, NA, 1

#S matrix
S.Seed.BB <- matrix(c(                
2.243,  3.055,  1.657,  -2.166,  12.424,  27.105,  2.205,
3.055, 41.942,  2.079,  -2.392,  15.390,  37.759,  0.565,
1.657,  2.079,  1.396,  -1.655,   9.960,  15.360,  -1.238,
-2.166, -2.392, -1.655,   2.164, -12.328, -25.099,  -1.791,
12.424, 15.390,  9.960, -12.328,  72.492, 129.491,  -0.004,
27.105, 37.758, 15.360, -25.099, 129.491, 456.913,  108.861,
2.205,  0.565, -1.238,  -1.791,  -0.004, 108.861,  56.239),7,7,byrow=TRUE)
rownames(S.Seed.BB) <- colnames(S.Seed.BB) <-
c('Site','B.B','Over.Comp','Under.Comp','BA','Under.Cob', 'BB.Cob')

#sem function
sem.BB.1 <- sem(mod.BB.1, S.Seed.BB, N=40)

Thanks a lot for any suggestions!


-----
Biol. Verónica Chillo
Grupo de Investigaciones de la Biodiversidad (GIB)
Instituto Argentino de Investigaciones de Zonas Áridas (IADIZA) - CCT Mendoza, CONICET, Argentina
Av. Ruíz Leal s/n, Parque San Martín, (CP5500) Mendoza Ciudad, Mendoza, Argentina.
Tel. +54-261-5244130
http://personal.cricyt.edu.ar/vchillo/
--
View this message in context: http://r.789695.n4.nabble.com/sem-error-message-tp4608784.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list