Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • weighted correlations using svyset and svy

    Hi Statalisters,

    I am hoping to get weighted correlations and the appropriate p-values using survey data. I have tried the -corr_svy- command and the correlations do not appear to differ from the correlations using the -corr- command which does not account for weighting and sampling design. I have read that it may not be possible to get obtain weighted correlations with Stata 14 (https://stats.idre.ucla.edu/stata/seminars/survey-data-analysis-with-stata-14/)but any help regarding a workaround is appreciated.

    svyset [pweight= W7C17P_20], jkrweight(W7C17P_21-W7C17P_240) vce(jack) mse
    corr_svy


    Thanks!
    -Jenn

  • #2
    corr_svy is an old command written by Nick Winters in 2001 A look at the ado file ("viewsource corr_svy.ado") shows that it was written for Stata 7, which had very different syntax for svyset. The solution is run your do file under version control and use the old svyset syntax, some of which I found here :
    Code:
    sysuse auto, clear
    version 7
    svyset psu rep78
    svyset pweight length
    corr_svy mpg weight length
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Hmm. I doubt that svyset in Stata 7 accepted replicate weights, so this won't work. Sorry.
      Steve Samuels
      Statistical Consulting
      [email protected]

      Stata 14.2

      Comment


      • #4
        A bit out of date, but look at the solution Statacorp gave to this issue back in 2014 (posting in case this comes up for anyone else googling this issue).

        Comment

        Working...
        X