[GRASS-stats] help coding an anova using raster data

Sam Veloz sdveloz at ucdavis.edu
Thu Nov 20 23:56:39 EST 2008


I would like to run an anova on a set of raster variables imported from 
GRASS into R but am confused about how R handles the raster data. So if 
I have a model with a treatment with 2 levels, each raster is a binary 
file with cells coded for each level of the treatment. I have 1 response 
raster layer that corresponds spatially with the treatment layers. So 
let's say I have 5 rasters representing a different rep of the treatment 
how would I code this in R? I started out trying this:

treatment<-readRAST6(c("rep1","rep2","rep3","rep4","rep5"),cat=TRUE)
response<-readRAST6("response",cat=FALSE)
test.aov<-aov(response~treatment)

but I don't think this is right. Is it possible to do what I am trying? 
My data is actually a bit more complicated than this but if I can clear 
this up than I think I can do the rest on my own.
Thanks for your help,
Sam

-- 
****************************************************
Sam Veloz
Postdoctoral Researcher
Department of Environmental Science and Policy
University of California, Davis
sdveloz at ucdavis.edu


More information about the grass-stats mailing list