Suppose I have a couple of variables (say, y and x) that have the same values when another variable (say, z) has the same value (for example, I have observations for individuals in a country, x and y are characteristics of the city an individual lives in, and z is the city itself).
I want to regress y on x (so I care about cities, not about individuals), but if I just ask Stata to do it, I will get incorrectly calculated standard errors (there are many individuals in each city, and error terms will be correlated). Is there any simple and standard way to treat all observations with the same z as one while running regression? So to speak, to make Stata use equivalence classes as a sample?
Thanks.
I want to regress y on x (so I care about cities, not about individuals), but if I just ask Stata to do it, I will get incorrectly calculated standard errors (there are many individuals in each city, and error terms will be correlated). Is there any simple and standard way to treat all observations with the same z as one while running regression? So to speak, to make Stata use equivalence classes as a sample?
Thanks.
Comment