I would like some help with selecting the appropriate model for a nested ANOVA using SAS. I have a data set with d15n as the response variable and year, grid and station as class variables. I sampled over two years and sampled from in the same three grids in each year, but in each grid I sampled from three random stations in each year/grid treatment. In each station I sampled 10 individual. That gives me two unique years, three uniquie grids (sampled in each year) and 18 unique stations in total (9 stations in each year) and 180 individuals. I want to know if there are differences between years, across regions and within regions while taking to account the nested design.

**For example, here is my code and results proc ANOVA with Station nested in Grid:**

proc ANOVA data=krill.krillsas;

Class YEAR Station grid;

model d15n = year grid station(grid);

Test h = grid e = station(grid);

run;

quit;

-----------------------------------------------------------------------

The ANOVA Procedure

Dependent Variable: d15N d15N

Sum of

Source DF Squares Mean Square F Value Pr > F

Model 18 62.58333101 3.47685172 23.41 <.0001

Error 161 23.91340945 0.14853049

Corrected Total 179 86.49674046

R-Square Coeff Var Root MSE d15N Mean

0.723534 11.93692 0.385397 3.228610

Source DF Anova SS Mean Square F Value Pr > F

Year 1 5.84134491 5.84134491 39.33 <.0001

Grid 2 22.11300289 11.05650144 74.44 <.0001

Station(Grid) 15 34.62898321 2.30859888 15.54 <.0001

Tests of Hypotheses Using the Anova MS for Station(Grid) as an Error Term

Source DF Anova SS Mean Square F Value Pr > F

Grid 2 22.11300289 11.05650144 4.79 0.0246

-----------------------------------------------------------------------

**But should I also nest grid within year? If so would I would guess the SAS Code would be:**

proc ANOVA data=krill.krillsas;

Class YEAR Station grid;

model d15n = year grid grid(year) station(grid);

Test h = year e = grid(year);

Test h = grid e = station(grid);

run;

quit;

-----------------------------------------------------------------------

The ANOVA Procedure

Dependent Variable: d15N d15N

Sum of

Source DF Squares Mean Square F Value Pr > F

Model 20 63.61355008 3.18067750 22.10 <.0001

Error 159 22.88319038 0.14391944

Corrected Total 179 86.49674046

R-Square Coeff Var Root MSE d15N Mean

0.735444 11.75017 0.379367 3.228610

Source DF Anova SS Mean Square F Value Pr > F

Year 1 5.84134491 5.84134491 40.59 <.0001

Grid 2 22.11300289 11.05650144 76.82 <.0001

Grid(Year) 2 1.03021907 0.51510953 3.58 0.0302

Station(Grid) 15 34.62898321 2.30859888 16.04 <.0001

Tests of Hypotheses Using the Anova MS for Grid(Year) as an Error Term

Source DF Anova SS Mean Square F Value Pr > F

Year 1 5.84134491 5.84134491 11.34 0.0780

Tests of Hypotheses Using the Anova MS for Station(Grid) as an Error Term

Source DF Anova SS Mean Square F Value Pr > F

Grid 2 22.11300289 11.05650144 4.79 0.0246

-----------------------------------------------------------------------

**Or would it be best use PROC NESTED:**

proc sort data=krill.krillsas;

by year grid station;

proc nested data=krill.krillsas;

class year grid station;

var d15n;

run;

quit;

-----------------------------------------------------------------------

The SAS System 12:36 Tuesday, July 12, 2011 46

The NESTED Procedure

Coefficients of Expected Mean Squares

Source Year Grid Station Error

Year 90 30 10 1

Grid 0 30 10 1

Station 0 0 10 1

Error 0 0 0 1

Nested Random Effects Analysis of Variance for Variable d15N

Variance DF Sum of FValue Pr>F Error Mean Variance % of

Source Squares Term Square Component Total

Total 179 86.496740 0.483222 0.512989 100.000

Year 1 5.841345 1.01 0.3719 Grid 5.841345 0.000617 0.1203

Grid 4 23.143222 2.50 0.0980 Station 5.785805 0.115756 22.5650

Station 12 27.757419 12.59 <.0001 Error 2.313118 0.212945 41.5105

Error 162 29.754754 0.183671 0.183671 35.8041

d15N Mean 3.22860975

Standard Error of d15N Mean 0.18014415

-----------------------------------------------------------------------

I am not quite sure if I understand each of these methods/results and which is best to use. As you can see they give slightly different results. Also I am not sure how to interpret the hypothesis tests that use the nested factor(s) as the error term in the PROC ANOVA examples. Also these codes do not examine the interaction between year & grid (or can they with the nested design?). Give the structure of my data, any advice on what is best would be greatly appreciated!

Cheers,

Mike