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

st: Using weights for Pearson correlations (statalist-digest V4 #2044)


From   Paul Seed <[email protected]>
To   [email protected]
Subject   st: Using weights for Pearson correlations (statalist-digest V4 #2044)
Date   Mon, 25 Jul 2005 11:59:03 +0100

Richard Williams <[email protected]> suggested the following code:
<snip>


. 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

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.
All very interesting and as I would expect, but why is version 8.32 of
svyset needed?  And why do the correlations change if I use
version 9?

. webuse nhanes2f.dta
. svyset [pw=finalwgt], clear

      pweight: finalwgt
          VCE: linearized
     Strata 1: <one>
         SU 1: <observations>
        FPC 1: <zero>

. corr_svy female black height, sig

Survey Correlation

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

Number of observations: 10337

             |      female       black      height
-------------+------------------------------------
      female |      1.0000
             |
             |
       black |      0.0099      1.0000
             |      0.3115
             |
      height |     -0.6987      0.0057      1.0000
             |      0.0000      0.5592
--------------------------------------------------
Key: Estimated Correlation
     Significance Level




=========================
Paul T Seed
King's College London,
Division of Reproductive Health, Endocrinology and Development

St Thomas' Hospital,
Lambeth Palace Road,
London SE1 7EH

Funded by the Wellcome Trust & Tommy's the Baby Charity

([email protected])
tel   (+44) (0) 20 7188 3642
fax (+44) (0) 20 7620 1227



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