Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: st: Stata coding to SAS


From   Steve Samuels <sjsamuels@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: st: Stata coding to SAS
Date   Wed, 16 Jan 2013 12:17:24 -0500

I agree with Stas's diagnosis.

Statum h:  n_h subjects N_h population total

In Stata: post weights are N_h, but normalized are: N_h/n_h, so sum to
N_h in the stratum

In SAS: probability weights are N_h, so sum to n_h x N_h in the stratum.

To get corresponding weights in SAS, KC could create "probability
weights" for SAS as wt_h = N_h/n_h.

But post-strata are technically subpopulations (also known as "domains"), so,
depending on sample size, the standard errors given by SAS could  be
wrong. There's also a question of whether reference groups are the same for
the predictor with reference group "3" in SAS.


KC specifies a subpopulation "european" in his analyses.
Post-stratifying with a subpopulation can give poor results if
population and subpopulation stratum proportions are very different. In
such a case KC could be better off not post-stratifying.KC's sample
might not have been drawn SRS, so that even Stata might not be giving
proper standard errors. All in all, I'd like to see more information and the
results as I requested.


Steven Samuels
Consulting Statistician
18 Cantine's Island
Saugerties, NY 12477 USA
845-246-0774




On Jan 16, 2013, at 10:57 AM, Stas Kolenikov wrote:

Stata's -postweight()- is the target sum of weights for a given
poststrata, rather than a weight variable as you specified for SAS.
Besides, I am not sure SAS supports poststratification, unlike Stata.


-- 
-- Stas Kolenikov, PhD, PStat (SSC)  ::  http://stas.kolenikov.name
-- Senior Survey Statistician, Abt SRBI  ::  work email kolenikovs at
srbi dot com
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer

On Wed, Jan 16, 2013 at 9:05 AM, Steve Samuels <sjsamuels@gmail.com> wrote:
> KC
> 
> You will have a better chance of getting an answer to your question if,
> as the FAQ request, you show the results of all commands.
> 
> Also note that the one "rule" on Statalist is to use full names.
> If you are professionally known as "KC Wong", then please give your
> affiliation.
> 
> Steve
> 
> 
> Steven Samuels
> Consulting Statistician
> 18 Cantine's Island
> Saugerties, NY 12477 USA
> 845-246-0774
> 
> 
> On 12 January 2013 KC Wong wrote:
> 
> 
>> I wish to translate the below Stata coding to SAS and I'm wondering if
>> I have the SAS coding right because the result from Stata differs from
>> SAS's.
>> I'm now using StataIC 11.
>> 
>> Stata:
>> svyset _n,  poststrata(poststrata) postweight(aweight)
>> svy, subpop(european): logistic case  i.age_cat i.interviewmethod
>> i.status i.deprivation
>> 
>> SAS:
>> proc surveylogistic data=bc;
>> strata poststrata;
>> weight aweight;
>> domain european;
>> class age_cat(ref="0") interviewmethod(ref="3") deprivation(ref="0")
>> / param=ref;
>> model case(event="1") = age_cat  interviewmethod status deprivation;
>> run;
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index