Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: how to include aweight variable in xtreg


From   Yinghui Li <[email protected]>
To   [email protected]
Subject   st: how to include aweight variable in xtreg
Date   Tue, 05 Dec 2006 09:35:18 -0800

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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index