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

 From Lee Sieswerda To "'statalist@hsphsun2.harvard.edu'" Subject st: RE: Adjusted means and proportion for Survey data Date Wed, 18 Dec 2002 17:19:29 -0500

Judging by the code, -adjmean- and -adjprop- don't work with 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

Lee Sieswerda, Epidemiologist
Thunder Bay District Health Unit
999 Balmoral Street
Thunder Bay, Ontario
Tel: +1 (807) 625-5957
Fax: +1 (807) 623-2369
Lee.Sieswerda@tbdhu.com
www.tbdhu.com

> -----Original Message-----
> From:	riteshm [SMTP:riteshm@ucla.edu]
> Sent:	Wednesday, December 18, 2002 12:55 PM
> To:	statalist@hsphsun2.harvard.edu
> Subject:	st: Adjusted means and proportion for Survey data
>
> I am working with survey data.  Due the complex design of the survey it
> requires the use of survey procedures (svy...)in Stata to properly
> calculate
> the standard errors.  I would like to calculate adjusted means and
> proportions, but don't know how to do this and account for survey design
> at
> the same time.
>
> More specifically, I would like to calculate 1) adjusted proportions for a
> binary outcome by a binary variable while controlling for a set of
> covariates which are a combination of binary, categorical and continuous
> variables; and 2) adjusted means for a continuous outcome by a binary
> variable while controlling for a set of covariate similar to 1 above.
>
> I did the above using the adjprop and adjmean procedures, but these don't
> account for the survey design.
>
> I would really any help in this matter.
>
> Thanks,
>
> Ritesh
>
> *
> *   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/
*
*   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/