0
$\begingroup$

I have 2 high schools, School A and School B. For the first school, I have 5 classes of students; for the second, I have 3 classes (so 8 classes in total). Within each class, I have different categorical information about each student, for example whether they're male, whether they study French, etc.

The number of students in each class is different.

So the data might look like this (for example):

SCHOOL A

  • Class 1: 50 students, 20 males, and 5 students who study French
  • Class 2: 300 students, 50 males, and 8 students who study French
  • ...
  • Class 5: 25 students, 17 males, and 3 students who study French

SCHOOL B

  • Class 1: 140 students, 80 males, 10 students who study French
  • Class 2: 2500 students, 600 males, 110 students who study French
  • Class 3: 200 students, 110 males, 9 students who study French

What test to I do to assess whether there is a significant difference in the number of males or students who study French between School A and School B?

I'm confused because the different sample sizes presumably mean we should be looking at proportions, but if I look ONLY at proportions, am I still factoring in the magnitudes of the original values? (e.g. far more students are males than study French, so 6/100 students studying French v.s. 3/100 will look small in terms of proportion changes) Would it be a t-test on the proportions?

$\endgroup$
2
  • 1
    $\begingroup$ Comparing proportions while factoring in the sample sizes is exactly what chi squared tests do. $\endgroup$ Commented Jun 22, 2020 at 9:51
  • $\begingroup$ Please use more informative titles $\endgroup$
    – Radost
    Commented Jun 22, 2020 at 10:07

1 Answer 1

0
$\begingroup$

Since every variable is categorical (school, gender, topic studied), you can run a chi-squared test for independence. You want to compare proportions while factoring in the sample sizes, this is exactly what chi-squared tests do.

Simply compute what the expected numbers are in case of mutual independence of all variables, and compute the statistic $$\chi^2=\sum \frac{(O-E)^2}{E}$$ where $O$ stands for Observed numbers and $E$ stands for Expected. The degree of freedom of the system is the product "number of schools $-1$" times "number of topics $-1$" times "number of genders $-1$". Given the way the question is asked, the classes are irrelevant.

$\endgroup$
3
  • $\begingroup$ Thanks very much! So with chi-squared, I can see that I can obtain a p-value corresponding to the difference for the two populations as a whole (factoring in all the categorical variables), but is it possible using this test to get a p-value specific to one of the variables (e.g. French), and a separate one for the differences in another variable (e.g. number of subjects studied), etc.? $\endgroup$
    – AM128
    Commented Jun 22, 2020 at 10:49
  • $\begingroup$ @AM128 Sure, you can always ignore some variables and merge the cells accordingly, run the test, then repeat with other variables. $\endgroup$ Commented Jun 22, 2020 at 11:22
  • $\begingroup$ Great - really appreciated! $\endgroup$
    – AM128
    Commented Jun 22, 2020 at 11:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .