I'm not particularly advanced when it comes to statistics and data analysis and have a problem I can't seem to solve. Basically, suppose you're doing school research and have three groups (to which student participants have been randomly assigned) - a control group, and two experimental groups. Your whole participant pool is say 27 students (tiny I know, but helps with the example)
However, within each group you have clusters of students who belong to the same class. For example, within the control group there are 3 students who all belong to class A, 3 who all belong to Class B, and 3 who all belong to class C. Same situation for the other two groups - within each there are small clusters of students (e.g. 3-5 students) who all belong to the same class.
The situation looks like this:
Now I get that there's a problem here and that the problem is one of "clustered data." One solution that has been suggested to me is "de-meaning" for each class, in other words:
Step 1: Calculate the mean for each class (e.g. Class A) Step 2: Subtract the mean for each class from every observation in that class
Now the means of each class become 0 and there are no longer any "between class" differences. This (apparently) gets rid of the clustering problem. You might end up with a set of data that looks like this:
My first question is: is this a good solution to the problem?
My second question is essentially: what do you do next?
I'm assuming you could now just run a normal one-way ANOVA on the data, just as you would have done with the "raw" data if there hadn't been any clustering.
But I've gathered from posts elsewhere that you have to "correct the degrees of freedom" or something like that, because you've "used up" some of them in estimating the means for each class. Can somebody explain this?
Thanks so much for your help! Really appreciate it as this is doing my head in,