It all depends on how you coded your plot factor variable. I'm assuming here that you used year,site and plot as group variables. If you coded plots with an identifier within site but they are the same across sites
For example
Site Plot
A 1
A 2
B 1
B 2
Then ~site+plot would fit 3 parameters: 1) an intercept for Site A, plot 1, 2) a site B value, and 3) a plot 2 value. This would treat plot 1 and 2 as the same across sites.
If you fitted ~site*plot it will fit 4 parameters: 1) an intercept for Site A, plot 1, 2) a site B value, and 3) a plot 2 value, 4) a site B-Plot 2 interaction value. This would treat plots differently across sites which is what you want because site is nested in plot.
Now if your data was setup as
Site Plot
A 1
A 2
B 3
B 4
Then ~plot will fit a model with 4 parameters and is the same as ~site*plot with plot defined as 1 or 2. If you used ~site*plot with plot defined as 1 to 4, it will be over-parameterized because it will try to fit 8 parameters. If instead you used ~-1+site:plot then it will fit 4 parameters.
Since year is crossed with site and plot then it can be treated as either additive or an interaction. The interaction with year could be over just site if the thinking was a year difference would differ across sites but the same within plot.
You can work out a lot of this for yourself by creating a dummy dataframe and using model.matrix to look at the design matrix. Even though RMark does the work of creating DMs for you, you need to understand DMs and what the formula is creating. Here are some examples of what I described above
- Code: Select all
> df=data.frame(year=rep(c("1","2"),each=4),plot=rep(c("A","B"),each=2),site=rep(c("1","2"),4))
> df
year plot site
1 1 A 1
2 1 A 2
3 1 B 1
4 1 B 2
5 2 A 1
6 2 A 2
7 2 B 1
8 2 B 2
> str(df)
'data.frame': 8 obs. of 3 variables:
$ year: Factor w/ 2 levels "1","2": 1 1 1 1 2 2 2 2
$ plot: Factor w/ 2 levels "A","B": 1 1 2 2 1 1 2 2
$ site: Factor w/ 2 levels "1","2": 1 2 1 2 1 2 1 2
> model.matrix(~site+plot,df)
(Intercept) site2 plotB
1 1 0 0
2 1 1 0
3 1 0 1
4 1 1 1
5 1 0 0
6 1 1 0
7 1 0 1
8 1 1 1
attr(,"assign")
[1] 0 1 2
attr(,"contrasts")
attr(,"contrasts")$site
[1] "contr.treatment"
attr(,"contrasts")$plot
[1] "contr.treatment"
> model.matrix(~site*plot,df)
(Intercept) site2 plotB site2:plotB
1 1 0 0 0
2 1 1 0 0
3 1 0 1 0
4 1 1 1 1
5 1 0 0 0
6 1 1 0 0
7 1 0 1 0
8 1 1 1 1
attr(,"assign")
[1] 0 1 2 3
attr(,"contrasts")
attr(,"contrasts")$site
[1] "contr.treatment"
attr(,"contrasts")$plot
[1] "contr.treatment"
> model.matrix(~year+site*plot,df)
(Intercept) year2 site2 plotB site2:plotB
1 1 0 0 0 0
2 1 0 1 0 0
3 1 0 0 1 0
4 1 0 1 1 1
5 1 1 0 0 0
6 1 1 1 0 0
7 1 1 0 1 0
8 1 1 1 1 1
attr(,"assign")
[1] 0 1 2 3 4
attr(,"contrasts")
attr(,"contrasts")$year
[1] "contr.treatment"
attr(,"contrasts")$site
[1] "contr.treatment"
attr(,"contrasts")$plot
[1] "contr.treatment"
> model.matrix(~year*site+site*plot,df)
(Intercept) year2 site2 plotB year2:site2 site2:plotB
1 1 0 0 0 0 0
2 1 0 1 0 0 0
3 1 0 0 1 0 0
4 1 0 1 1 0 1
5 1 1 0 0 0 0
6 1 1 1 0 1 0
7 1 1 0 1 0 0
8 1 1 1 1 1 1
attr(,"assign")
[1] 0 1 2 3 4 5
attr(,"contrasts")
attr(,"contrasts")$year
[1] "contr.treatment"
attr(,"contrasts")$site
[1] "contr.treatment"
attr(,"contrasts")$plot
[1] "contr.treatment"
>