Announcement

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

  • 95% CI for partial Pearson correlation?

    Dear Statalisters,

    I am trying to obtain a 95% confidence interval for a partial correlation coefficient, using the -pcorr- command with bootstrapping.

    I have been running this in the 'auto' dataset, with the following code:

    -sysuse auto-
    -bootstrap r(rho), reps(1000) nodots seed(1): pcorr mpg weight length-

    but I get the following error message returned:

    " 'r(rho)' evaluated to missing in full sample
    r(322)"


    I appreciate that there was a similar thread here: https://www.statalist.org/forums/for...orr-with-stata
    but this only actually looked at -pwcorr- and not -pcorr-.


    Would anyone be able to shed any light on what I am failing to see and offer any suggestions as to how i could obtain these CIs, if indeed it is possible?

    Thank you in advance,

    Tom Norris

  • #2
    Welcome to Statalist.

    The end of the output of both help pwcorr and help pcorr describe the results stored by each of the commands. We see that pwcorr stores r(rho) containing the pairwise correlation between the first two variables specified. A different approach is taken by pcorr, which stores a vector of partial correlation coefficients in r(p_corr) and a vector of semipartial correlation coefficients in r(sp_corr). You will have to modify your bootstrap code appropriately.

    Comment

    Working...
    X