[R] how to use chi-square to test correlation question

Leeds, Mark (IED) Mark.Leeds at morganstanley.com
Wed Jun 27 18:58:28 CEST 2007


someone else might have another viewpoint but I think your categories
needs to be score categories ( 60-65, 65-70 etc )  
and the data needs to be the number of girls and boys that fall into a
category. I've never seen this "below a certain value" 
Methodology  but maybe it's popular and I just don't know about it. 
I'm unsure if you can assign success and failure in a chi square
framework by "below a certain value". I don't think so. And I think
That you also have seperate multiple experiments ( each level seems like
a new experiment to me ) so your alpha level is going to be messed up
also. I'd be interested in hearing other viewpoints but I'm fairly
certain that your approach needs modifications.



-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of
genomenet at gmail.com
Sent: Wednesday, June 27, 2007 11:51 AM
To: r-help-request at stat.math.ethz.ch
Subject: [R] how to use chi-square to test correlation question

Hi There,

There are 300 boy students and 100 girl students in a class. One
interesting question is whether boy is smarter than girl or not.

first given the exam with a difficulty level 1, the number of the
student who got A is below
31 for boy, 10 for girl.

Then we increase the difficulty level of the exam to level 2, the number
of the student who got A is below
32 for boy, 10 for girl.

We did this 10 times, we got the following table
                                    score gender  level1 level2 levle3
level4 level5 level6 level7 level 8 level9 level10
boy       31     32      33     34     35     36     37     38     39
40
girl      10     10      10     10     10     10     10     10     10
10


My question is how to use chi-square test to test if score is
independent of gender.
That is whether boys is significantly smarter than girls.

I used a chisquare test to do this.
The null hypothesis is score is not correlated with gender. and we can
also say the null hypothesis is boys are the same smart as girls.
the alternative hypothesis is that boys are significantly smarter than
girls.

boyscore=c(31,32,33,34,35,36,37,38,39,40)
girlscore=c(10,10,10,10,10,10,10,10,10,10)
ratioscore=boyscore/girlscore;
expratio=300/100;   #300 boy students and 100 girl students

chisq=sum((expratio-ratioscore)^2/expratio)
df=9
pvalue=1-pchisq(chisq,df)

Since the pvalue (0.9984578) is greater than significance level (0.05),
we cannot reject the null hypothesis. Therefore the conclusion is that
boys are not significantly smarter than girls.
or we can say the conclusion is that score is not correlated with
gender.

Am I right?

Thank you very much.

Van

______________________________________________
R-help at stat.math.ethz.ch 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.
--------------------------------------------------------

This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}



More information about the R-help mailing list