[R-sig-ME] corGaus specification
jjclark
jjclark at email.unc.edu
Tue Jun 8 21:21:54 CEST 2010
I'm trying to run a linear mixed model with a spatial gaussian correlation
using the lme function. I have a y, a linear term, x, and 5 additional
variables (z1,z2,z3,z4,z5) for each observation and am trying to build a
model with a random effect for each observation with the z variables used
in the gaussian correlation. In SAS the following code builds this model:
proc mixed data=dat;
class obs;
model y=x / ddfm=bw;
random obs/type=sp(gau)(z1 z2 z3 z4 z5);
run;
I am still fairly new to using R and have tried using the following code to
build this same model with no success:
cobs=factor(obs)
lme(y ~ x, dat, random = ~ 1|cobs, correlation = corGaus(form = ~
z1+z2+z3+z4+z5|cobs))
The code runs when I take out the correlation specification, but with it I
get the following error:
Error in corFactor.corSpatial(object) : NA/NaN/Inf in foreign function call
(arg 1)
In addition: Warning messages:
1: no non-missing arguments to min; returning Inf in:
min(unlist(attr(object, "covariate")))
2: no non-missing arguments to min; returning Inf in:
min(unlist(attr(object, "covariate")))
All the z’s are between 0 and 1 and are non-missing. Can anyone give me
some pointers as to how to specify the Gaussian spatial correlation for
mixed models either here or perhaps in another R function? Thank You!
Jennifer
More information about the R-sig-mixed-models
mailing list