On Nov 5, 2015, at 1:45 AM, Thierry Onkelinx <thierry.onkelinx at inbo.be> wrote:
Dear Karl,
You have only 2 levels of cost. So it better to move that to the fixed effects. Then you'll have only one random effect.
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
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
2015-11-04 23:50 GMT+01:00 Karl Jarvis <karljarvis at gmail.com <mailto:karljarvis at gmail.com>>:
Hi all,
I am trying to build a model that includes two random effects while also using a correlation structure to account for spatial autocorrelation. It?s a full factorial study on simulations of wildlife where individuals are spread across landscapes, so one of the random effects (N) is crossed.
If I use nlme I can do this by reusing creating a new group factor by pasting the three crossed factors together (would be land:barr:mort in lme4), which I call ?lr'. The parameter estimates are similar, so it seems ok. (Link to the data frame: https://drive.google.com/open?id=0B096pYMrPnKAdC1FdWhCR3Z4bjg <https://drive.google.com/open?id=0B096pYMrPnKAdC1FdWhCR3Z4bjg><https://drive.google.com/open?id=0B096pYMrPnKAdC1FdWhCR3Z4bjg <https://drive.google.com/open?id=0B096pYMrPnKAdC1FdWhCR3Z4bjg>> )
ibr4 <- read.csv(?~/ibr4.csv?)
m1 <- lme(A ~ barr + mort, random = list(~cost | land, ~N | lr), data=ibr4, method = ?ML?)
Once I try to do that along with a correlation structure, it complains that there are incompatible formulas for ?random? and ?correlation?.
m2 <- lme(A ~ barr + mort, random = list(~cost | land, ~N | lr), data=ibr4, method = ?ML?,
correlation = corExp(form = ~ x+y | lr))
I think it?s because it doesn?t know how to relate lr to land, because it complains the same way when the only random effect is '~cost | land?. However, when one random effect is in the model with a correlation structure nested as ~x+y | land/barr/mort, it does work. But it doesn?t seem to ever accept multiple random effects together with a correlation structure. I know Pinheiro and Bates say in their book (p.163) that you can build a crossed random-effects structure with pdBlocked and pdIdent, but (1) it?s not clear to me how to do this for a single random effect, and (2) it?s not clear to me that you could include multiple random effects in such a structure. Am I misunderstanding how correlation structures and/or random effects work? Let me know if you need more information about my data.
Thanks,
Karl
[[alternative HTML version deleted]]