# Standard error clustering: Does it depend on the variable of interest?

Suppose I am interested in whether a students age affects their performance, and I run the following regression:

$$performance(i) = \beta_1 age(i) + \beta_2 Female(i)+\beta_3 classsize(i)+\varepsilon(i),$$

where $$performance(i)$$ is student i's performance, $$Female(i)$$ is a dummy variable which is one if the student is female and $$classsize(i)$$ is the number of students in the same class.

I am interested (only) in $$\beta_1$$. If I collect the data from all students of a given school, the problem of correlated errors across a given class arises. That is $$classize(i)=classsize(j)$$ for all student $$i,j$$ who are in the same class. Therefore, if I was interested in the effect of class size on performance, I would need to cluster the standard errors on class level (i.e. a categorical variables which groups the classes). If I am not interested in $$\beta_3$$ at all, (but I want to include it in the regression because I worry about omitted variable bias), would I still need to cluster the data on class level? What if I include a categorial variable in the regression ("class fixed effect")?

More generally: Is standard-error-clustering related to the variable(s) of interest OR to the general setup of the data?

Edit: Suppose the data is collected for 100 schools that were randomly chosen, and for each of those schools, every student enters the survey.

• Can you clarify how the sampling was done and how that relates to the effect of age on performance? For example, do you want to make a claim about that effect in other schools that were not sampled? – Dimitriy V. Masterov Aug 26 at 18:05