logo.gif The source for online courses
in statistics
 ÖÐÎÄ Course Login
Home > Resources > Discussion Boards
statistics.com
statistics.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ANOVA with R, help needed for a simple example

 
Post new topic   Reply to topic    statistics.com Forum Index -> Statistical Methods
View previous topic :: View next topic  
Author Message
frodo.jedi



Joined: 03 Jun 2010
Posts: 12

PostPosted: Fri Jun 04, 2010 1:22 pm    Post subject: ANOVA with R, help needed for a simple example Reply with quote

Hi all,
I have problems in understanding how to perform ANOVA with R.

I have a very simple case to analize. I did an experiment with a recognition task. I presented 3 types od stimuli: audio, visual and audio-visual.
I want to know if the differences are statistically significant, i.e. if with the audio-visual stimuli the performances are better than the audio stimuli or the visual stimuli.

Here the row data (frequencies):

| Correct answers | Wrong answers
Visual  | 49 | 31
Audio | 59 | 41
Audio-Visual | 80 | 20


Can you please give me a R code example in order to perform this analisis?
I really have problems in understanding, even if I tried to study different materials.

Help!

Thanks in advance

Frodo
Back to top
View user's profile Send private message
alethephant



Joined: 06 Sep 2006
Posts: 200
Location: Virginia Beach

PostPosted: Fri Jun 04, 2010 10:20 pm    Post subject: ANOVA with R Reply with quote

This is not actually an ANOVA application. It is a contingency table application.

> x<- matrix(c(49,31, 59,41, 80,20), ncol=2, byrow=TRUE)
> rownames(x)<- c('Visual','Audio', 'Audio-Visual')
> colnames(x)<- c('Correct','Wrong')
> x
Correct Wrong
Visual 49 31
Audio 59 41
Audio-Visual 80 20
> chisq.test(x)
Pearson's Chi-squared test
data: x
X-squared = 11.7579, df = 2, p-value = 0.002798

> chisq.test(x[1:2,])
Pearson's Chi-squared test with Yates' continuity correction
data: x[1:2, ]
X-squared = 0.0234, df = 1, p-value = 0.8783

> chisq.test(x[c(1,3),])
Pearson's Chi-squared test with Yates' continuity correction
data: x[c(1, 3), ]
X-squared = 6.7992, df = 1, p-value = 0.00912

> chisq.test(x[2:3,])
Pearson's Chi-squared test with Yates' continuity correction
data: x[2:3, ]
X-squared = 9.4351, df = 1, p-value = 0.002129

Row 3 has a different proportion correct than rows 1 and 2, which are indistinguishable.
Back to top
View user's profile Send private message
frodo.jedi



Joined: 03 Jun 2010
Posts: 12

PostPosted: Sat Jun 05, 2010 3:31 am    Post subject: Reply with quote

Hello,
thanks a lot for your answer. I know the chi square test (also with R), and also for me it would be better to apply it for this case. But I must apply the ANOVA, and moreover I want to learn it.

Could you help me?

Cheers


Frodo
Back to top
View user's profile Send private message
frodo.jedi



Joined: 03 Jun 2010
Posts: 12

PostPosted: Wed Jun 09, 2010 10:57 am    Post subject: Reply with quote

Hi all,
the formulation of my problem was not correct in order to justify the ANOVA.
With that data was better to use a chi-square test.

The ANOVA can be applied in this case if I formulate the problem in this way:

H=c(7,7,7,7,7,7,7,7,7,0,7,7,7,7,7)
H_1=c(7,7,7,6,7,7,7,7,7,1,7,7,6,7,7)
H_2=c(7,7,7,7,7,7,7,7,7,0,7,7,7,6,7)
H_S1=c(6,7,7,7,7,7,7,7,6,7,3,7,6,7,6)
H_S2=c(7,7,7,7,6,7,7,7,6,4,5,7,7,7,7)
H_S3=c(1,2,1,2,6,7,1,7,6,4,5,1,11,1)

I need to know if the differences between these groups are statistically significant. I need to find also the p-values.

At the moment I have problems with the R code. Please help.

Indeed from one side I do not understand the difference between the functions aov() and anova().
From the other side I am not able to apply them ;-(

Could you please give me a quick example with these data?

Thanks in advance

Best regards

Frodo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    statistics.com Forum Index -> Statistical Methods All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group