Dear Alex,
I'm cc'ing this to the mixed models list which is more appropriate for
the question. Please send all follow up posts only to that list.
First a few more general remarks.
- You are using the data argument of glmmPQL. So there is no need to attach()
the data.frame. I recommend avoid to use attach(). You will get into troubles
with it, sooner or later...
- The correlation structures of the nlme package (which is used by glmmPQL),
work on the residuals WITHIN the groups at the deepest levels of the random
effects. So in your case only within individual sites. I guess that you are more
interested in spatial correlation among sites than within sites.
- Adding a random intercept per site is equivalent of adding a compound symmetry
correlation structure along site.
- which kind of residuals did you look at? You need the normalised one to see
the effect of the correlation structure.
Then there is a more theoretical remark. Does a correlation structure on the
residuals makes sense when using a binomial or poisson model? Compare is the
formula notation of a (gaussian) linear (mixed) model with that of a generalised
linear (mixed) model. You'll see that the lmm formula contains an epsilon
term where the generalised version does not. This makes sense when you look at
the distributions. The Gaussian distribution is defined by two parameters: mu (=
combined effect of fixed and random effect) and sigma (the standard deviation of
the epsilons). The binomial disitribution is only defined by one parameter: mu
(= combined effect of fixed and random effect). It's variance depends on mu.
The correlation structures of nlme work on the epsilons, changing there joint
distribution from i.i.d. (thus non correlated) to the specified correlation
structure. So how will that work on a generalised model where you have no
epsilons?
Another reasoning is that a correlation struction in a gaussian models affects
the variance (sigma) but not the mean (mu). But in binomial case those
parameters are linked. So if the correlation structure has an effect on the
variance then it must have an effect on the mean. And thus it will be
conflicting with the fixed and random effects.
What IMHO would make sense for a generalised model are correlated random
effects. E.g. the BLUPs of nearby sites have a stronger correlation than BLUPs
of distant sites. Those kind of correlation structure are currently not
available in neither nlme nor lme4.
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx at inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than
asking him to perform a post-mortem examination: he may be able to say what the
experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure
that a reasonable answer can be extracted from a given body of data.
~ John Tukey
-----Oorspronkelijk bericht-----
Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
Namens Alexroyan
Verzonden: dinsdag 29 mei 2012 15:06
Aan: r-help at r-project.org
Onderwerp: [R] GLMMPQL spatial autocorrelation
Dear all,
I am experiencing problems using the glmmPQL function in the MASS package
(Venables & Ripley 2002) to model binomial data with spatial
autocorrelation.
My question - is the presence of birds affected by various hydrological
parameters?
Presence/absence data were collected from 83 sites and coupled against
hydrological data from the same site. The bird survey sampling effort varied at
each site so I want to include this as a random effect (fAVGNTS). I have also
conducted a join count test which suggests that there is some spatial
autocorrelation. Consequently I have used the following code:
library(MASS)
attach(Birds)
Birds$x <- Birds$LONGITUDE
Birds$y <- Birds$LATITUDE
M <- glmmPQL(PRESENCE~ HYDROVAR1 + HYDROVAR2, random= ~ 1|fAVGNTS,
correlation = corExp(form = ~ x + y), family = binomial(link =
"logit"), data = Birds)
The model seems to run fine. However, when I compare the results of this model
and the residual spread against the same model but without the correlation
function, there is absolutely no difference at all.
I am somewhat confused by this as both Dormann et al. 2007 and Bivand et al.
2008 have suggested the use of the glmmPQL function to model binomial data with
spatial autocorrelation and random effects.
Therefore I am wondering if anyone knows why this has occurred and secondly I am
wondering if the correlation function does indeed work outside of gls?
Many thanks in advance for your help.
Best regards
--
View this message in context:
http://r.789695.n4.nabble.com/GLMMPQL-spatial-autocorrelation-tp4631689.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
R-help at 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.
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en
binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer
and may not be regarded as stating an official position of INBO, as long as the
message is not confirmed by a duly signed document.