[R] Testing significance in a design with unequal but proportional sample sizes

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Mar 5 17:40:49 CET 2004


Those are contrasts treating the interaction as a set of four treatments, 
not an interaction between two factors.  So you would need to set 
contrasts on the factor ab <- a:b (outside a formula), with formula 
a+b+ab.

On Fri, 5 Mar 2004, Christophe Pallier wrote:

> 
> 
> Prof Brian Ripley wrote:
> 
> >On Fri, 5 Mar 2004, pallier wrote:
> >
> >...
> >
> >  
> >
> >>Actually, the different types of main effects defined above just 
> >>correspond to different
> >>contrasts on the cell means. So if there is an easy solution to compute 
> >>arbitrary contrasts
> >>on the cell means in a factorial design, this could an approach to this
> >>question. (Anyone?)
> >>    
> >>
> >
> >There are at least three such ways.  ?contrasts (for the assignment
> >function contrasts<-)  and ?C, as well as the contrasts= argument to aov 
> >(the function you were discussing ...).
> >  
> >
> Thanks.
> I know the existence of 'contrasts' and I read the  section about 
> contrasts matrix in your book (MASS 3rd edition), as well as
> in the R online documentation, but I probably do not understand them 
> well: It still escapes me how to proceed to compute
> "arbitrary" contrasts, such as, say:
> 
> a1b1 a1b2  a2b1 a2b2
>    1       1      -1      -1
> 
> a1b1 a1b2  a2b1 a2b2
>   .5      .5       -1       0
> 
> in a model "x~ a * b"  where a and b are two binary factors.
> 
> (the contrasts should be on the cell means, ignoring the sample size of 
> subgroups. I know how to compute the size of the contrasts from the 
> table of means returned by tapply, but I whould also need the associated 
> MSE).
> 
> Sorry if the solution is obvious.
> 
> Christophe Pallier
> 
> 
> 
> 
> 

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list