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

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


From   Nick Winter <[email protected]>
To   [email protected]
Subject   Re: st: Using weights for Pearson correlations (statalist-digest V4 #2044)
Date   Mon, 25 Jul 2005 12:47:21 -0400

Hi all,

There is a Stata FAQ on correlations and survey data, at:

http://www.stata.com/support/faqs/stat/survey.html

The technique recommended there is the one that I implemented in corr_svy, which you can download from SSC.

You must use version 8.2 with svyset, because corr_svy does not recognize the version 9 svyset.

--Nick Winter


At 06:59 AM 7/25/2005, you wrote:

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/
--------------------------------------------------------
Nicholas Winter                           607.255.8819 t
Assistant Professor                       607.255.4530 f
Department of Government              [email protected] e
308 White Hall            falcon.arts.cornell.edu/nw53 w
Cornell University
Ithaca, NY 14853-4601

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