Announcement

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

  • Non-parametric partial/semipartial correlation

    Good morning,
    Is there a way in Stata to perform non-parametric (Spearman) partial correlation? Something analogous to . pcorr x y z -?
    Thank you in advance for a feedback.
    Best greetings,
    Piotr Lewczuk

  • #2
    Dear Piotr,

    You can use the Stata function spearman
    Type help spearman in the command window.

    Possibly this webpage offers you some more background information.
    http://publicationslist.org/eric.melse

    Comment


    • #3
      Good morning,
      Are you sure one can run P A R T I A L correlation with . spearman?
      One of us have obviously not read what the other writes
      So, I'm still waiting for an answer, greetings,
      Piotr

      Comment


      • #4
        Dear Piotr,
        I suppose what you are looking for is possible with Richard Williams' PCORR2: Stata module to display partial and semipartial correlation coefficients.
        Code:
        ssc install pcorr2

        That provides partial and semi-partial statistics, as discussed by Richard Williams in Semipartial (Part) and Partial Correlation.

        Next, I follow the recommendation of Nick Cox:
        I can't speak for some alternative software that you are invoking here, but -egen, rank()- will rank your variables, after which partial correlations can be calculated in the usual way.
        Some example of how to proceed:
        Code:
        use https://stats.idre.ucla.edu/stat/stata/notes/hsb2 , clear
        
        foreach var in read write math science socst {
        egen rnk_`var' = rank(`var')
        }
        
        * Assuming that a students' science performance is somehow determined, in part, by performance at other subjects:
        pcorr2 rnk_science rnk_read rnk_math rnk_write rnk_socst
        
        * result omitted
        I hope this is helpfull.
        Last edited by ericmelse; 26 Apr 2018, 03:32.
        http://publicationslist.org/eric.melse

        Comment


        • #5
          Dear Eric,
          Thanks for pointing at pcorr2 and the paper; I am wondering what it means that pcorr2 "is a modified and enhanced version of Stata's pcorr command." (as it stays in the help for pcorr2).

          Yes, I was aware of the Dr. Cox's suggestion to first rank the variable and then to run "usual" parametric partial correlation with pcorr (or pcorr2), I was just wondering, given that this suggestion is already a couple of years old, if there are any more direct approaches available meanwhile.

          Anyway, thanks a lot for your feedback.

          Regards,
          Piotr Lewczuk

          PS: The question is still open, if somebody on the forum knows a more direct approach than by the ranking of a variable.


          Comment

          Working...
          X