[prev in list] [next in list] [prev in thread] [next in thread]
List: r-sig-mixed-models
Subject: [R-sig-ME] Data nested and spatial auto-correlation
From: Izaias Fernandes <biomedice () gmail ! com>
Date: 2011-11-25 12:57:07
Message-ID: CAEy+NRTw9S7iftdor1QbgZ+f4rhz_quUv6+o9PKbntdGDwEOWQ () mail ! gmail ! com
[Download RAW message or body]
I have 27 sites and each site has six samples. This is a classic case where
the data are nested. But the data, show spatial auto-correlation too.
Here, there are the firsts lines of the table:
Site
Samples
X
Y
OD
A
1
573773
8190515
3.65
A
2
573805.7
8190535
3.65
A
3
573830.7
8190554
3.75
A
4
573802.3
8190595
3.7
A
5
573837.4
8190615
3.6
A
6
573855.9
8190573
2.9
B
1
573766
8191513
3.65
B
2
573806.5
8191480
4
B
3
573848.4
8191473
4.5
B
4
573892
8191479
4.75
B
5
573936.4
8191495
4.75
B
6
573993.9
8191594
4.7
Where: 1 at 6 are samples in each site. X and Y are geographics coordinates
and OD are the value of the variable.
How do I remove the effect of space? What is the best option?
I adjusted the model using the *function gls (Generalised least squares)*
of *package nlme:*
OD2.a<-gls(OD~1, data=table)
M1C.a<-gls(OD~1,correlation=corRatio(form=~X+Y,nugget=TRUE),data=table)
M1E.a<-gls(OD~1,correlation=corExp(form=~X+Y,nugget=TRUE),data=table)
M1S.a<-gls(OD~1,correlation=corSpher(form=~X+Y,nugget=TRUE),data=table)
M1L.a<-gls(OD~1,correlation=corLin(form=~X+Y,nugget=TRUE),data=table)
M1G.a<-gls(OD~1,correlation=corGaus(form=~X+Y,nugget=TRUE),data=table)
AIC(OD2.a, M1C.a, M1E.a, M1S.a, M1L.a, M1G.a)
Despite the M1C.a was the best model, showing the effect of the spatial
auto correlation, but the data are nested.
I want to generate values (residuals) without the effect of the space and
use the values in *Mixed Effects Model:*
OD.model<-lme(OD.new~X1+X2+X3, random=~1| Site, data= table)
This is possible?
Thanks
--
Izaias M. Fernandes
Doutorando em Biologia de Água Doce e Pesca Interior
Instituto Nacional de Pesquisas da Amazônia - Brazil
[[alternative HTML version deleted]]
_______________________________________________
R-sig-mixed-models@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic