# 2-way randomized block ANOVA in R

I'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 would not categorize it as repeated measures since almost no two sampling periods are the same.

I believe that the correct way to analyze these data would be to use a 2-way randomized block ANOVA. The months would be the blocking factor in the analysis. I got some results, but was unsure if the code used was correct.

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?

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
Reach 03    3   2013    BP      Active
Reach 03    4   2013    BP      Active
Reach 03    5   2013    BP      Active
Reach 03    6   2013    BP      Active 0.143           1    6.993006993
Reach 03    7   2013    BP      Active
Reach 03    8   2013    BP      Active
Reach 03    9   2013    BP      Active
Reach 03    10  2013    BP      Active
Reach 03    11  2013    BP      Active
Reach 09    3   2013    BP      Active
Reach 09    4   2013    BP      Active
Reach 09    5   2013    BP      Active
Reach 09    6   2013    BP      Active
Reach 09    7   2013    BP      Active
Reach 09    8   2013    BP      Active
Reach 09    9   2013    BP      Active
Reach 09    10  2013    BP      Active  1.097222222    0    0
Reach 09    11  2013    BP      Active
Reach 09    3   2014    MF      Passive
Reach 09    4   2014    MF      Passive 96             0    0
Reach 09    5   2014    MF      Passive 96             2    0.020833333
Reach 09    6   2014    MF      Passive 336            0    0
Reach 09    7   2014    MF      Passive 336            0    0
Reach 09    8   2014    MF      Passive 96             0    0
Reach 09    9   2014    MF      Passive 96             0    0
Reach 09    10  2014    MF      Passive 96             0    0
Reach 09    11  2014    MF      Passive 96             0    0
Reach 08    3   2014    MF      Passive
Reach 08    4   2014    MF      Passive 96             1    0.010416667
Reach 08    5   2014    MF      Passive 96             0    0
Reach 08    6   2014    MF      Passive 96             9    0.09375
Reach 08    7   2014    MF      Passive 96             0    0
Reach 08    8   2014    MF      Passive 96             6    0.0625
Reach 08    9   2014    MF      Passive 96             0    0
Reach 08    10  2014    MF      Passive 96             0    0
Reach 08    11  2014    MF      Passive
Reach 10    3   2014    MF      Passive
Reach 10    4   2014    MF      Passive 96             0    0
Reach 10    5   2014    MF      Passive 96             1    0.010416667
Reach 10    6   2014    MF      Passive 336            0    0
Reach 10    7   2014    MF      Passive 720            0    0
Reach 10    8   2014    MF      Passive 480            0    0
Reach 10    9   2014    MF      Passive 96             0    0
Reach 10    10  2014    MF      Passive 96             0    0
Reach 10    11  2014    MF      Passive 96             0    0
Reach 08    3   2014    MT      Passive
Reach 08    4   2014    MT      Passive
Reach 08    5   2014    MT      Passive
Reach 08    6   2014    MT      Passive
Reach 08    7   2014    MT      Passive 648            2    0.00308642
Reach 08    8   2014    MT      Passive
Reach 08    9   2014    MT      Passive
Reach 08    10  2014    MT      Passive
Reach 08    11  2014    MT      Passive
Reach 11    3   2014    MT      Passive
Reach 11    4   2014    MT      Passive
Reach 11    5   2014    MT      Passive 504            0    0
Reach 11    6   2014    MT      Passive 168            3    0.017857143
Reach 11    7   2014    MT      Passive 1440           0    0
Reach 11    8   2014    MT      Passive
Reach 11    9   2014    MT      Passive
Reach 11    10  2014    MT      Passive
Reach 11    11  2014    MT      Passive

• Please review the wiki for the [analysis] tag. Can you provide a sample of your data? I don't see anything about Month, how are you dealing with that? – gung Oct 23 '15 at 16:18
• That's what I'm trying to figure out. The information that I've looked at doesn't explicitly say how to block for something in R and just offer up code instead. So I believed I was blocking correctly. Here is some sample data however. – NotThatKindofDr Oct 23 '15 at 16:20
• Please edit your Q (click the gray "edit" under the [anova] tag), & paste your data into the body of your Q. – gung Oct 23 '15 at 16:27
• Hours, Caught, etc. are missing for some rows. Was there no data collection for those combinations? What's going on there? You state there are 21 sites; I only see 7. Is this just a part of the data? – gung Oct 23 '15 at 16:34
• Because they are zero and have no subsequent value. They are just in the data as placeholders. – NotThatKindofDr Oct 23 '15 at 16:35