[R] pcorr -- Partial and semipartial correlation coefficients
pcorr varname varlist [if] [in] [weight]
varlist may contain factor variables; see fvvarlist.
varname and varlist may contain time-series operators; see tsvarlist.
by is allowed; see [D] by.
aweights and fweights are allowed; see weight.
Statistics > Summaries, tables, and tests > Summary and descriptive
statistics > Partial correlations
pcorr displays the partial and semipartial correlation coefficient of a
specified variable with each variable in a varlist after removing the
effects of all other variables in the varlist. The squared correlations
and corresponding significance are also reported.
. sysuse auto
. pcorr price mpg weight foreign
pcorr stores the following in r():
r(N) number of observations
r(df) degrees of freedom
r(p_corr) partial correlation coefficient vector
r(sp_corr) semipartial correlation coefficient vector