0

've been trying to analyze my data set and I believe that I am on the right track, but need some conformation. I'm trying to analyze the catch rate of fishes along several reaches of the same river and evaluate the effectiveness of the type of gear used over 2 years of study.

My data consists of:

1) 21 Different Sites 2) Sampling Techniques categorized as "Active" or "Passive" 3) 2 years of data gathering separated by month.

The sites were not sampled uniformly over the course of the study. They were not all sampled every month, not all for the same amount of time, nor with the same sampling techniques. I believe you could categorize it as a non-repeating measure since almost no two sampling periods are the same.

I believe that the correct way to analyze this data would be to use a 2-way Randomized Block ANOVA. The months would be what is being blocked in the analysis. I got some results, but was unsure if the code used was the correct one.

Would anyone be able to proof the code I used and confirm/deny that it is indeed the correct code for a 2-Way Randomized Block design in R?

Fish<-read.csv(file.choose(),header=TRUE)
Fish
FishLM<-lm(Caught.Hr ~ Site + Method + Site:Method,Fish)
anova(FishLM)

Here is some sample data:

Site     Month  Year    Device  Method  Hrs/Month   Caught  Caught/Hr  
Reach 01    5   2014    BS      Active  0.7            0    0  
Reach 01    6   2014    BS      Active  7.92           0    0  
Reach 01    7   2014    BS      Active  5.73           0    0  
Reach 01    8   2014    BS      Active  1.82           0    0  
Reach 01    9   2014    BS      Active  10.08          0    0  
Reach 01    10  2014    BS      Active  10.08          0    0  
Reach 01    11  2014    BS      Active  6.9            0    0  
Reach 02    3   2013    BS      Active  2.5            0    0  
Reach 02    4   2013    BS      Active  2.5            0    0  
Reach 02    5   2013    BS      Active  3.75           0    0  
Reach 02    6   2013    BS      Active  17.3           0    0  
Reach 02    7   2013    BS      Active  2.5            0    0  
Reach 02    8   2013    BS      Active  2.5            0    0  
Reach 02    9   2013    BS      Active  2.5            0    0  
Reach 02    10  2013    BS      Active  2.5            0    0  
Reach 02    11  2013    BS      Active  2.5            0    0  
Reach 03    3   2013    BS      Active  3              0    0  
Reach 03    4   2013    BS      Active  3              0    0  
Reach 03    5   2013    BS     Active   2.5            0    0  
Reach 03    6   2013    BS     Active   3.5            1    0.285714286  
Reach 03    7   2013    BS     Active   3              0    0  
Reach 03    8   2013    BS     Active   3              0    0  
Reach 03    9   2013    BS     Active   3              1    0.333333333  
Reach 03    10  2013    BS     Active   8.75           2    0.228571429  
Reach 03    11  2013    BS      Active  3              0    0  
Reach 04    3   2013    MT      Passive           
Reach 04    4   2013    MT      Passive           
Reach 04    5   2013    MT      Passive           
Reach 04    6   2013    MT      Passive 72             0    0  
Reach 04    7   2013    MT      Passive 120            2    0.016666667  
Reach 04    8   2013    MT      Passive 120            0    0  
Reach 04    9   2013    MT      Passive 72             0    0  
Reach 04    10  2013    MT      Passive           
Reach 04    11  2013    MT      Passive           
Reach 07    3   2014    MF      Passive           
Reach 07    4   2014    MF      Passive 96             7    0.072916667  
Reach 07    5   2014    MF      Passive 96             5    0.052083333  
Reach 07    6   2014    MF      Passive 96             8    0.083333333  
Reach 07    7   2014    MF      Passive 96             1    0.010416667  
Reach 07    8   2014    MF      Passive 96             1    0.010416667  
Reach 07    9   2014    MF      Passive 96             3    0.03125  
Reach 07    10  2014    MF      Passive 96            10    0.104166667  
Reach 07    11  2014    MF      Passive           

Thanks.

  • 1
    It would be very helpful if you would provide some example data. Please read this on [how to ask a good question](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – alexwhitworth Oct 23 '15 at 16:17

1 Answers1

0

If I'm reading your question correctly (and I'm not sure that I am), you are trying to examine the variation in a continuous variable Caught.Hr which you believe to be normally distributed--hence ANOVA. In addition, you have two treatment effects: Site and Method and you have repeated measures on a monthly basis.

Your model is thus

$$Y_{ijk} = \mu + S_i + M_j + (SM){ij} + \epsilon{ijk}$$

where
- Y_{ijk} is the catch rate at site i with method j in time period k.
- mu represents the population average catch rate
- S_i indicates the effect of each site,
- M_j indicates the effect of each sampling method,
- (SM)_{ij} is the interaction effect,
- e_{ijk} is random variation

I fail to see, from your description, what your blocking factor is. It just sounds like you have an unbalanced design. It appears to me, from your description, that you do not have a randomized block design. You have a Factor design with two factors, which is also unbalanced.

But yes, this would work:

FishLM<-lm(Caught.Hr ~ Site + Method + Site:Method,Fish)
anova(FishLM)

Edit:

I think that what I've said above is valid based on your data. Though I do have a concern that you're using ANOVA. This appears to be count data ie- poisson not normal distribution. eg:

# This has problems based on hours / obs
Fishglm <- glm(Caught ~ Site + Method + Site:Method, data=Fish, 
  family= poisson(link = "log"))
# could use neg-binomial on the rate instead.
library(MASS)
Fishnb <- glm.nb(Caught.Hr ~ Site + Method + Site:Method, data=Fish)
alexwhitworth
  • 4,839
  • 5
  • 32
  • 59