| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: how to include aweight variable in xtreg
Dear Statalisters,
I have a question about xtreg and need your help!
I used xtreg to generate a linear regression model with random effect,but
I also want to set a variable as aweight. However xtreg doesn't accept aweight.
-------------------------------------------
* Add facility as random effects *
encode fac_id, gen( n_fac_id );
xtreg y x1 x2 x3, re i( n_fac_id );
-----------------------------------------
Now there is another variable ave_height which is average height of
people in each facility, I want
to set it as weight. According to WEIGHT in Stata, it should be
aweight. But xtreg only allows
iweights, fweights, and pweights ,it doesn't accept aweight.
Could you please tell me how to do it or do you know if there is any
other method to do the similar
thing which wants to generate a linear regression model, with random
effect, with weighted variable?
Many thanks in advance! I am looking forward to your reply!
Yinghui
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/