Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Using weights for Pearson correlations


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: Using weights for Pearson correlations
Date   Sun, 24 Jul 2005 22:49:20 -0500

At 08:27 PM 7/24/2005 -0500, Mosi A. Ifatunji wrote:
Well,

I tried the suggested syntax with aweights and got it to work. The problem
is that I AM interested in significance levels. I tried using fweights and
iweights but the command does not work (just like with pweights).

I also tried using the svy command(s). The basic suite of svy commands are
do not allow correlations. But I did find a command online that allows
correlations using the svy command: findit corr_svy. After setting up the
svy command suite with my weights (using svyset) and downloading the
corr_svy command, I ran the corr_svy command and compared it with the
results from the [aw=wights] command.

The results are the same.
In what sense are they the same? I would expect the correlations to be the same, but not the confidence intervals/ significance tests. Here is an example:

. webuse nhanes2f.dta

. version 8.2: svyset [pw=finalwgt], clear
pweight is finalwgt

. pwcorr female black height [aw=finalwgt], sig

| female black height
-------------+---------------------------
female | 1.0000
|
|
black | 0.0157 1.0000
| 0.1102
|
height | -0.7041 -0.0041 1.0000
| 0.0000 0.6800
|

. corr_svy female black height, sig

Survey Correlation

pweight: finalwgt
Strata: <one>
PSU: <observations>

Number of observations: 10337

| female black height
-------------+------------------------------------
female | 1.0000
|
|
black | 0.0157 1.0000
| 0.1741
|
height | -0.7041 -0.0041 1.0000
| 0.0000 0.7185
--------------------------------------------------
Key: Estimated Correlation
Significance Level

See? Exact same correlation estimates, but different estimates of the significance levels. It isn't obvious from these particular printouts, but in general specifying pweights produces the same results as specifying aweights and robust.

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