Statalist The Stata Listserver

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

st: RE: weights in tabulate, summarize

From   "Nick Cox" <>
To   <>
Subject   st: RE: weights in tabulate, summarize
Date   Mon, 10 Jul 2006 20:44:32 +0100

Your bottom line is the important one here:

"i can't use svy commands because i am not 
provided with psu and strata information".

If I understand this properly, you need
information on how your survey was set up 
but do not have it. In this situation 
pretending that your weights are really 
aweights or iweights just to get a result 
has absolutely no justification. In fact
it is very bad practice. You should 
tell your "boss" this immediately and 
ask him or her why they are expecting 
you to do the impossible. 

Compatibility with SAS or not is secondary 
here. The fact that you get the same 
answer to some wrong questions in both 
packages is not very helpful scientifically. 
Similarly, the (apparent) fact that you 
can get an answer to another wrong question
in one package but not in another is not
very surprising. It is very difficult to
write software that will stop users getting
results when they are asking the wrong question.


Lan Jiang
> i want to calculate weighted frequencies for category variables and
> weighted means and std for continuous variables.
> i used SAS weight statement to get the results and tests, but my boss
> wants me to use stata to check the results because the way how SAS
> deals with weights is known not as good as stata.
> i am provided with a non-response adjusted selection 
> probability in the
> data.  i wanted to use [pw=myweightvar] but apparently it is 
> not allowed.
> i used [aw=myweightvar] and [iw=myweightvar].  the weighted 
> frequencies
> are the same, and they are consistent with my results from SAS ouput.
> but i can't use chi2 option with the above [aw=] and [iw] 
> statement.  I
> could get chi2 statistics from SAS though. there must be some 
> way to test
> the independence of the distribution in stata in this case.  
> please kindly
> advise.
> also for continous variables, i used tabulate categoryvar
> [aw=myweightvar], summarize(continousvar)
> again, pw is not allowed, even iw is not allowed.
> i get the same weighted means compared to sas output, but the 
> std is much
> much smaller than what i get from sas output.  i am wondering why.  in
> this case, i would trust sas output more because apparently 
> aw is dealing
> with averages, and my weights should be treated using pw, which is not
> available here. i also need to test the differences over the 
> levels of the
> category variable.  i don't know how to conduct this test in stata.
> please advise.
> by the way, i can't use svy commands because i am not 
> provided with psu
> and strata information.

*   For searches and help try:

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