# [R] se.contrast

Don Driscoll Don.Driscoll at flinders.edu.au
Tue Feb 24 07:05:53 CET 2004

```G'day,

I'm fitting a simple one-way nested anova and would like to obtain standard
errors or confidence limits.  I'm using se.contrast to try to get se for
the contrast between the two levels of the main effect, but I get an error
message (see below).  What is going on?

Don

> shp<-factor(rep(c("reserve","strip"),each=96))
> site<-factor(rep(c("1g","1p",
"1t","2g","2p","2t","3g","3p","3t","4g","4p","4t"),each=16))
> pit<-factor(rep(1:16,12))
>
reptsp<-c(4,5,6,4,6,6,6,7,3,5,2,2,4,8,5,4,2,4,2,2,4,5,2,4,4,4,3,2,3,2,5,3,5,3,4,4,4,3,4,3,4,4,4,3,4,3,6,3,3,5,4,6,4,4,2,4,2,6,5,5,5,7,4,4,5,1,4,5,6,5,5,2,6,3,5,6,4,5,4,8,2,4,2,4,2,4,3,3,4,4,3,2,1,3,4,4,2,2,3,2,4,1,2,2,3,4,5,5,3,5,5,4,1,1,2,1,3,1,4,1,6,1,2,3,2,2,2,1,1,2,2,6,5,3,2,3,5,3,2,3,2,1,3,2,4,4,3,3,3,1,2,4,3,4,5,6,5,2,3,2,2,5,5,5,2,2,5,2,4,4,3,2,2,3,2,2,2,2,5,4,3,3,5,2,5,4,3,2,2,2,1,2)
> ddata<-data.frame(shp,pit,site,reptsp)
> #Fit a Standard Nested Anova Model
> repmod1<-aov(reptsp~shp/site/pit+ Error(shp/site/pit))
> summary(repmod1)

Error: shp
Df Sum Sq Mean Sq
shp  1  53.13   53.13

Error: shp:site
Df Sum Sq Mean Sq
shp:site 10 61.885   6.189

Error: shp:site:pit
Df Sum Sq Mean Sq
shp:site:pit 180 318.56    1.77
> se.contrast(repmod1, list(shp=="strip", shp=="reserve"),data=ddata)
Error in rep.int(n.object - 1, nrow(c.qr) - length(e.assign)) :
invalid number of copies in "rep"

```