Which correlation test should I use?

There are 45 schools and each school has a different number of students. All 45 schools can be ranked accordingly to the number of students from the school with the lowest to the school with the highest number of students.

I'd like to perform a cross-sectional analysis of flu illness in all schools and my hypothesis is that the schools with higher number of students will have a higher rate of flu illnesses and average duration of illness. The rate is calculated as the number of cases of flu per total number of students in that school. The average duration of illness is in days.

I believe that there is a linear relationship between number of students and flu rate (as the number of students go up the flu rate will also go up) as well as there is a linear relationship between number of students and average duration of illness (as the number of students go up the average duration of illness will also go up).

My goal is to construct a linear graph as well as to perform some statistical analyses to show the correlation.

My question is which stat tests can use and which correlation test is the best fit for this problem?

• Why do you assume a linear relationship between number of students and average duration of illness?
– JonB
Sep 26, 2015 at 20:04
• the biological mechanism is complex and there is a way to test it statistically
– Sean
Sep 26, 2015 at 20:26
• I am a medical doctor and I was wondering out of curiosity, as my field is far from infectious diseases.
– JonB
Sep 26, 2015 at 20:39
• in brief I believe that flu virus gains strength while passing from one person to the next one.
– Sean
Sep 26, 2015 at 21:42
• Can you post some doctored (no pun intended) toy data set resembling vaguely the real numbers, so that I can work with it and get you something even more concrete? Also, can I assume you're using [R]? Sep 26, 2015 at 22:09

I think that you have a problem that can be modeled as a Poisson process or a binomial - I guess depending on the season or the year, although in general the widespread promotion of vaccination is likely to have reduced the overall annual incidence. Possibly this post may help with the general framing of the question, especially the comment by Willam Huber (@whuber).

So I believe you can summarize the data in a $2$ x $n$ contingency table (whether you do it or not doesn't change the concept), with $n$ corresponding to your schools under study, and the two rows showing the tally of cases of flu for every school in one cell, and the kids who didn't get the flu on the adjacent cell.

The first thing to test is whether there is a statistically significant difference overall between the schools with an omnibus $\chi^2$ test. You can look up the details in a recent post here. Basically, you'll be looking at whether the deviations from the expected counts are reasonably understood as noise, or they should prompt to consider that you may be dealing with real differences. After that you can do pairwise comparisons, also included in the post in terms of [R] commands.

But I realize your question is more nuanced, and after running these tests, I would consider a Poisson generalized linear model of the type $\Tiny (Number\,of\,Cases\,/\,100\,students) \sim Number\,of\,Students$. In [R] the command would be fit <- glm(Cases_per_100_Students ~ Total_Students_in_School, family = "Poisson").

The second part of the question could possibly be studied with a scatterplot (Average Duration of Flu Cases ~ Number of Kids Attending School) and a Person's correlation coefficient. Alternatively you can try to fit a linear OLS model of the type fit <- lm(Duration_of_Symptoms ~ Number_of_Students_in_School).

So I hope you can get some ideas out of this. Cheers!

• Thank you! Would it be helpful to use a scatterplot for flu rate and number of kids attending school as well to see if there is any possible relationship (i.e. linear)? I might be missing something here but I am wondering if there is any visuals such as graphs or scatterplots before going for chi square?
– Sean
Sep 26, 2015 at 22:09
• @Sean, I think I did touch on this on my answer. I can post some simulation with R code for you to use, but I'd rather do it with some "taste" of what the real data looks like. You can distort it so that no professional issues arise. Also, please consider clicking on the up arrowhead beside the answer if you feel it was useful. Sep 26, 2015 at 22:12
• let me provide you with the data shortly. I tried to click on the arrowhead but it wont let me to raise the score I guess because I am new here... sorry I think your response was very helpful
– Sean
Sep 26, 2015 at 22:18
• Excellent! Your comment is more valuable than any arrows. Just make up something resembling reality. Send me a message if you want, and I can help you format it for the site. Welcome, btw. It's a great place to learn! Sep 26, 2015 at 22:20