[R-sig-ME] spatial correlation with nlme (Javier Moreira)

Highland Statistics Ltd highstat at highstat.com
Wed Aug 2 15:51:33 CEST 2017


> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 1 Aug 2017 22:43:30 -0300
> From: Javier Moreira <javiermoreira at gmail.com>
> To: r-sig-mixed-models at r-project.org
> Subject: [R-sig-ME] spatial correlation with nlme
> Message-ID:
> 	<CAEyHP-0=TXAbK-fpFH=otmJ0Tzkk_yJ_86K6-8L5MbxtbLQovw at mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> hi,
> im trying to generate different models to account for spatial correlation.
> Im using nlme package, and mixed models, in order to compare two models,
> one that doesnt include the spatial correlation and one that does.

As already indicated by Thierry...try R-INLA.

Alain


> Its a nested design, one that has 4 leves,
> BLOQUE/ AMBIENTE/ TRATAMIENTO/ SUBMUESTREO
> Its a harvest set data, with multiple point of data/ treatment, so the last
> level account for another term in the error for "sub-muestreo".
>
> My first problem its, when i try to add de correlation term to the model, i
> cant, when the random effects are taken to the level /SUBMUESTREO, and i
> have to leave it to the level of TRATAMIENTO.
> When i do that, i have 2 differences between models, the term accounting
> for sub-muestreo, and the spatial correlation.
>
> #MODELO 2##
> attach(base_modelo3)
> str(base_modelo3)
> data1=base_modelo3
> str(data1)
> data1=groupedData(REND.~1|BLOQUE/AMBIENTE/TRATAMIENTO/SUBMUESTREO,
> data=data1, units=list(y="(ton/ha)"))
> data1$TRATAMIENTO =factor(data1$TRATAMIENTO)
> data1$BLOQUE =factor(data1$BLOQUE)
> data1$AMBIENTE =factor(data1$AMBIENTE)
>
> modelo2_MM<-lme(REND.~1+TRATAMIENTO*AMBIENTE,
>                  random=~1|BLOQUE/AMBIENTE/TRATAMIENTO/SUBMUESTREO,
>                  weights=varComb(varIdent(form=~1|TRATAMIENTO)),
>                  data=data1,
>                  control=lmeControl(niterEM=150,msMaxIter=200))
> summary(modelo2_MM)
> anova(modelo2_MM)
>
> ##MODELO 4##
>
> modelo4_MM<-lme(REND.~1+TRATAMIENTO*AMBIENTE,
>                  random=~1|BLOQUE/AMBIENTE/TRATAMIENTO,
>                  weights=varComb(varIdent(form=~1|TRATAMIENTO)),
>                  correlation=corExp(form=~X+Y,nugget=T),
>                  data=data1,
>                  control=lmeControl(niterEM=150,msMaxIter=200))
> summary(modelo4_MM)
> anova(modelo4_MM)
>

-- 

Dr. Alain F. Zuur



Author of:
1. Beginner's Guide to Spatial, Temporal and Spatial-Temporal Ecological Data Analysis with R-INLA. (2017).
2. Beginner's Guide to Zero-Inflated Models with R (2016).
3. Beginner's Guide to Data Exploration and Visualisation with R (2015).
4. Beginner's Guide to GAMM with R (2014).
5. Beginner's Guide to GLM and GLMM with R (2013).
6. Beginner's Guide to GAM with R (2012).
7. Zero Inflated Models and GLMM with R (2012).
8. A Beginner's Guide to R (2009).
9. Mixed effects models and extensions in ecology with R (2009).
10. Analysing Ecological Data (2007).

Highland Statistics Ltd.
9 St Clair Wynd
UK - AB41 6DZ Newburgh
Tel:   0044 1358 788177
Email: highstat at highstat.com
URL:   www.highstat.com



More information about the R-sig-mixed-models mailing list