Skip to content

ANOVA with correlated errors

4 messages · Jose A. Hernandez, Paulo Justiniano Ribeiro Jr, Ole F. Christensen +1 more

#
Dear R colleagues,

My name is Jose Hernandez and work in the analysis of on-farm experiments.

I've been a R user for sometime now, however am still struggling figuring 
out some of my spatial analysis using R.

Most of my experiments have the following model:

Y_ij = Mu + r_i + T_j + e_ij

Where:
r_i is some replication and T_j some fixed treatment effect.

I many cases there is significant within block heterogeneity and therefore 
I can't assume that e_ij are iid.

An alternative is to use:

Y_ij = Mu + T_j + e_ij

And assume that:

e_ij follows some spatial covariance model such as exponential, spherical, etc.


Are there any R packages that will integrate spatial variability into the 
model ?

Thanks and advance and best regards !

Jose
#
Hi Jose
The function likfit() in the package geoR will fit those models.
Actually there is a data-set in the package with a similar structure
see:

require(geoR)
data(hoef)
help(hoef)

best
P.J.
On Thu, 13 May 2004, Jose A. Hernandez wrote:

            
Paulo Justiniano Ribeiro Jr
Departamento de Estat?stica
Universidade Federal do Paran?
Caixa Postal 19.081
CEP 81.531-990
Curitiba, PR  -  Brasil
Tel: (+55) 41 361 3471
Fax: (+55) 41 361 3141
e-mail: pj at est.ufpr.br
http://www.est.ufpr.br/~paulojus
#
Paulo

I think you need to provide a few more details here about how to fit 
those models using your function in geoR.
* note the r_i term, which means that the replications have different 
means. How would you specify this in your function ?
* I Assume the quantity of interest are the contrasts in T_j. Guess some 
manual fiddling is needed to obtain confidence intervals for these 
contrast ?

Alternatively, since the model is a multivariate Guassian, so it is 
definetely possible to do inference by figuring out what the mean vector 
and covariance matrix of the vector Y={Y_ij | i,j= ....} looks like, 
write down the likelihood function and use the nlm or optim function for 
maximising it.

Best regards Ole
Paulo Justiniano Ribeiro Jr wrote:

            

  
    
#
Jose, I think package nlme can deal with such models as well, and
it may be slightly more oriented towards the analysis of experiments
than geoR is, please correct me if I'm wrong.

Best regards,
--
Edzer
Jose A. Hernandez wrote: