Background
I have data from a field study in which there are four treatment levels and six replicates in each of two blocks. (4x6x2=48 observations)
The blocks are about 1 mile apart, and within the blocks, there is a grid of 42, 2m x 4m plots and a 1m wide walkway; my study only used 24 plots in each block.
I would like to evaluate evaluate spatial covariance.
Here is an example analysis using the data from a single block, without accounting for spatial covariance. In the dataset, plot
is the plot id, x
is the x location and y
the y location of each plot with plot 1 centered on 0, 0. level
is the treatment level and response
is the response variable.
layout <- structure(list(plot = c(1L, 3L, 5L, 7L, 8L, 11L, 12L, 15L, 16L,
17L, 18L, 22L, 23L, 26L, 28L, 30L, 31L, 32L, 35L, 36L, 37L, 39L,
40L, 42L), level = c(0L, 10L, 1L, 4L, 10L, 0L, 4L, 10L, 0L, 4L,
0L, 1L, 0L, 10L, 1L, 10L, 4L, 4L, 1L, 1L, 1L, 0L, 10L, 4L), response = c(5.93,
5.16, 5.42, 5.11, 5.46, 5.44, 5.78, 5.44, 5.15, 5.16, 5.17, 5.82,
5.75, 4.48, 5.25, 5.49, 4.74, 4.09, 5.93, 5.91, 5.15, 4.5, 4.82,
5.84), x = c(0, 0, 0, 3, 3, 3, 3, 6, 6, 6, 6, 9, 9, 12, 12, 12,
15, 15, 15, 15, 18, 18, 18, 18), y = c(0, 10, 20, 0, 5, 20, 25,
10, 15, 20, 25, 15, 20, 0, 15, 25, 0, 5, 20, 25, 0, 10, 20,
25)), .Names = c("plot", "level", "response", "x", "y"), row.names = c(NA,
-24L), class = "data.frame")
model <- lm(response ~ level, data = layout)
summary(model)
Questions
- How can I calculate a covariance matrix and include it in my regression?
- The blocks are very different, and there are strong treatment * block interactions. Is it appropriate to analyze them separately?