协方差在MySQL中怎么求_[求助]请教,如何求方差和协方差?

本文介绍了如何在Stata中求解协方差和方差,包括`correlate`和`pwcorr`命令的使用,以及各种选项如显示系数、显著性水平、调整显著性等。虽然内容不直接涉及MySQL,但提供了类似统计计算的参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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编辑过]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值