I have a variable of interest "X" and data on the values of "X" for a set of countries and years. Further, I have created an indicator variable "I" that defines each year (uniquely for each country, i.e. the indicator will not have the same value in 1969 for all countries) as part of group 1 or group 2 according to the value of another variable Y.
Now what I want to check is whether the variable X has different variance during years in group 1 versus years in group 2. I have thought of two ways of doing this
1st: A regular sdtest
Code:
sdtest X, by(I)
Code:
collapse(sd) X, by(I country) ttest X, by(I)
Obviously I could just perform this test individually for each country, but the idea is (especially since I have many more variables than X that I could test) that I would have some sort of pooled result. How do I control for the difference between countries in this sort of test? Is there a way to perform a test for difference in variances for each country and then pool them? I have tried looking around but I have not seen much information on this sort of issue, so any help would be appreciated.
0 Response to Test of Variances between Groups and across Countries
Post a Comment