help for correlate, pwcorr manual: [R] correlate
dialogs: correlate pwcorr
----------------------------------------------------------------------------------------------------------
Correlations (covariances) of variables or estimators
correlate [varlist] [weight] [if exp] [in range] [, means noformat covariance _coef wrap ]
pwcorr [varlist] [weight] [if exp] [in range] [, obs sig print(#) star(#) bonferroni sidak ]
by ... : may be used with the above commands; see help by.
aweights and fweights are allowed; see help weights.
The varlist following correlate may contain time-series operators; see help varlist.
Description
correlate without the _coef option displays the correlation or covariance matrix for varlist or, if
varlist is not specified, for all variables in the data. Observations are excluded from the
calculation due to missing values on a casewise basis.
pwcorr displays all the pairwise correlation coefficients between the variables in varlist or, if
varlist is not specified, all the variables in the dataset.
correlate with the _coef option displays the correlation or covariance matrix of the coefficients
from the most recently fitted model. varlist is not specified in this case.
Options used with correlate
means causes summary statistics (means, standard deviations, minimums, and maximums) to be displayed
along with the matrix.
noformat displays the summary statistic requested by the means option in g format regardless of the
display formats associated with the variables.
covariance displays the covariances rather than the correlation coefficients.
_coef displays the correlations (or covariances if covariance is also specified) between the
coefficients of the most recently fitted model.
wrap requests that no action be taken on wide matrices to make them readable. It is unlikely that
you will ever want to specify this option; it prevents Stata from breaking wide matrices into
pieces to enhance readability.
Options used with pwcorr
obs adds a line to each row of the matrix reporting the number of observations used in calculating
the correlation coefficient.
sig adds a line to each row of the matrix reporting the significance level of each correlation
coefficient.
print(#) specifies the significance level of correlation coefficients to be printed. Coefficients
with larger significance levels are left blank. print(10) or print(.1) would list only
coefficients significant at the 10% level or better.
star(#) specifies the significance level of coefficients to be starred. star(5) or star(.05) would
star all coefficients significant at the 5% level or better.
bonferroni makes the Bonferroni adjustment to calculated significance levels. This affects printed
significance levels and the print() and star() options. "pwcorr, print(.05) bonferroni" prints
coefficients with Bonferroni-adjusted significance levels of .05 or less.
sidak makes the Sidak adjustment to calculated significance levels. This affects printed
significance levels and the print() and star() options. "pwcorr, print(.05) sidak" prints
coefficients with Sidak-adjusted significance levels of .05 or less.
Examples
. correlate
. correlate mrgrate dvcrate medage
. correlate mrgrate dvcrate medage, covariance
. correlate mrgrate dvcrate medage [aw=pop], covariance
. regress y x1 x2 (substitute any estimation command for regress)
. correlate, _coef
. correlate, _coef cov
. pwcorr
. pwcorr price weight mpg displ
. pwcorr price weight mpg displ, sig obs
. pwcorr price weight mpg displ, sig bon
. pwcorr price weight mpg displ, star(.05)
. pwcorr price weight mpg displ, star(.05) bon
. pwcorr price weight mpg displ, print(.05) star(.01) bon
Also see
Manual: [R] correlate
Online: help for impute, pcorr, spearman, summarize, vce
[此贴子已经被作者于2009-5-2 8:16:48编辑过]