st: RE: RE: Adjusted means and proportion for Survey data

 From "Nick Winter" To Subject st: RE: RE: Adjusted means and proportion for Survey data Date Thu, 19 Dec 2002 08:42:43 -0500

```> -----Original Message-----
> From: Lee Sieswerda [mailto:Lee.Sieswerda@tbdhu.com]
> Sent: Wednesday, December 18, 2002 5:19 PM
> To: 'statalist@hsphsun2.harvard.edu'
> Subject: st: RE: Adjusted means and proportion for Survey data
>
>
> survey data
> because they are programmed to re-estimate a non-svy linear
> regression based
> on the arguments that you supply. As a 5-o'clock quickie, you
> might try
> calculating the adjusted mean the old-fashioned way. For example:
>
> <svyset this and that>
> svymean mpg
> local mpgmean = _b[mpg]
> svyreg price mpg foreign
>
> * mean of price, by foreign, adjusted for mpg
> di _b[_cons] + (_b[mpg]*`mpgmean') + (_b[foreign]*1)
> di _b[_cons] + (_b[mpg]*`mpgmean') + (_b[foreign]*0)
>
> The same logic applies to -adjprop-, only using logistic
> regression rather
> than linear regression.
>
> Of course, the little exercise above doesn't do all of the
> nice things that
> -adjmean- does, like graphs and confidence intervals. It may
> or may not be
> easy to alter -adjmean- to run -svyreg- rather than
> -regress-. It would make
> a potentially interesting project. However, The Two Towers
> opens tonight
> where I live and I'm going, so no working on code for me tonight!
>
> Regards,
> Lee

print confidence intervals and standard errors of the predictions, tho
not graphs.

. svyreg price mpg foreign
. svymean mpg if e(sample)
. local mpgmean=_b[mpg]
. adjust mpg=`mpgmean', by(foreign) se ci

--Nick Winter

*
*   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/
```