Dear Statalisters,
I am trying to use the xtgee command for an international panel and weight my observations according to the population in a country. The weights should correct for heteroscedasticity.
Having read in the manual that weights should be constant within panel, I have chosen the reverse square root of the population of the year 1992 as a weight for the whole time range and created an according variable which takes the same value for each year (only differing between countries).
However, trying to run:
xtgee y x1 x2 x3 .... yeardummies [iw = weight], robust corr(ar3) family(gauss) link(ident)
resulted in the message
weight must be constant within country_id
r(199);
The problem is: my weights are constant with a country ! (The problem is independent of the use of pweight instead)
Does anybody have a glimpse of where the mistake could be ?
Thanks a lot in advance,
Justina