I often get error messages indicating that Stata doesn't like the variable that I have chosen to cluster on. Consider the following model, which has student random effects and tries to cluster standard errors at the teacher level:
Code:
mixed absent ib(2).classtype ib("k").gradenum i.schid || stdntid:, cluster(tchid)
It produces the following error message:
highest-level groups are not nested within tchid
which is true, but so what? Why does the cluster option care whether students are clustered within teachers? Theoretically, it seems to me I should be able to cluster on teachers whether they nest students or not.
My best guess is that this is a computational issue -- some constraint used by Stata to keep the matrices involved in clustered standard errors manageable in size. But I don't know. Your expertise most appreciated.
0 Response to Why can't we cluster on anything we like?
Post a Comment