[R] Paired test for 2-way ANOVA

2009-04-20 Thread A Ezhil

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@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.


Re: [R] Paired test for 2-way ANOVA

2009-04-20 Thread Mike Lawrence
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 ezhi...@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@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. ~

__
R-help@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.