[R] Paired test for 2-way ANOVA

Mike Lawrence Mike.Lawrence at dal.ca
Mon Apr 20 15:47:22 CEST 2009


Paired (aka. Repeated measures, aka. within-Ss) tests can be achieved
by using aov() and specifying the within-Ss effect in the error term:

my_aov = aov( dependent_variable~between_Ss_variable*within_Ss_variable
+ Error(Ss_id/(within_Ss_variable)))

summary(my_aov)

On Mon, Apr 20, 2009 at 10:25 AM, A Ezhil <ezhil02 at yahoo.com> wrote:
>
> Hi,
>
> I have an experimental data with 2 factors: visit and treatment. Each subject has 2 visits and on each visit they get a treatment. We take samples before and after treatment. I can easily to do the 2-way ANOVA in R with visit and treatment as factors.
>
> anova( lm(data ~ visit*treatment) )
>
> If I want to do the same 2-way ANOVA for the paired samples, how can I do that? Is there any R packages for that?
>
> Thanks in advance.
>
> Kind regards,
> Ezhil
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Mike Lawrence
Graduate Student
Department of Psychology
Dalhousie University

Looking to arrange a meeting? Check my public calendar:
http://tr.im/mikes_public_calendar

~ Certainty is folly... I think. ~




More information about the R-help mailing list