{"id":7119,"date":"2024-04-14T15:01:02","date_gmt":"2024-04-14T07:01:02","guid":{"rendered":""},"modified":"2024-04-14T15:01:02","modified_gmt":"2024-04-14T07:01:02","slug":"\u76ae\u5c14\u68ee \u7edf\u8ba1\u5b66\u76f8\u5173\u6027\u5206\u6790_\u3010R\u8bed\u8a00\u3011\u8bfb\u61c2Pearson\u76f8\u5173\u5206\u6790\u7ed3\u679c","status":"publish","type":"post","link":"https:\/\/mushiming.com\/7119.html","title":{"rendered":"\u76ae\u5c14\u68ee \u7edf\u8ba1\u5b66\u76f8\u5173\u6027\u5206\u6790_\u3010R\u8bed\u8a00\u3011\u8bfb\u61c2Pearson\u76f8\u5173\u5206\u6790\u7ed3\u679c"},"content":{"rendered":"
\u3010R\u8bed\u8a00\u3011\u8bfb\u61c2Pearson\u76f8\u5173\u5206\u6790\u7ed3\u679c<\/p>\n
2018-09-14<\/p>\n
1.\u6570\u636e\u8bf4\u660e<\/p>\n
\u8fd9\u91cc\u6211\u5bf9R\u8bed\u8a00\u7684\u81ea\u5e26\u7684\u6570\u636e\u5305\u4e2dstates.x77(\u5173\u4e8e\u7f8e\u56fd50\u4e2a\u5dde\u7684\u67d0\u4e9b\u6570\u636e)\u7b2c1\u81f36\u5217\u768450\u4efd\u6570\u636e\u4ece\u7edf\u8ba1\u7684\u89d2\u5ea6\u4ee5\u53caR\u8bed\u8a00\u7684\u89d2\u5ea6\u8fdb\u884c\u5206\u6790\uff0c\u770b\u770bR\u8bed\u8a00\u662f\u600e\u4e48\u505a\u76f8\u5173\u5206\u6790\u7684\uff0c\u540c\u65f6\u600e\u4e48\u770b\u5206\u6790\u51fa\u7684\u7ed3\u679c<\/p>\n
\u9996\u5148\u6211\u4eec\u89c2\u5bdf\u4e00\u4e0bstates.x77\u4e2d\u7b2c1\u81f36\u5217\u7684\u6570\u636e\u53ca\u5176\u610f\u4e49<\/p>\n
\u5217\u540d \u89e3\u91ca \u5355\u4f4d<\/p>\n
Population \u4eba\u53e3 \u4eba<\/p>\n
Income \u4eba\u5747\u6536\u5165 \u7f8e\u5143\/\u4eba<\/p>\n
Illiteracy \u6587\u76f2\u7387 %<\/p>\n
Life Exp \u9884\u671f\u5bff\u547d \u5e74<\/p>\n
Murder \u8c0b\u6740\u7387 %(\u6bcf100\uff0c000\u4eba)<\/p>\n
HS Grad \u9ad8\u4e2d\u6bd5\u4e1a\u7387 %<\/p>\n
2.\u7edf\u8ba1\u5b66\u7684\u8ba1\u7b97\u8fc7\u7a0b<\/p>\n
(1)\u6211\u4eec\u62ff\u51fa\u6587\u76f2\u7387(\u8bbe\u4e3ax)\u548c\u9884\u671f\u5bff\u547d(\u8bbe\u4e3ay)\u6765\u4ece\u7edf\u8ba1\u7684\u89d2\u5ea6\u8ba1\u7b97\u76f8\u5173\u7cfb\u6570r\u4ee5\u53ca\u663e\u8457\u6027\u6c34\u5e73\u03b1\uff1a<\/p>\n
\u9996\u5148\uff0c\u6211\u4eec\u5047\u8bbe\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u7b26\u5408\u8ba1\u7b97Pearson\u76f8\u5173\u7cfb\u6570\u7684\u53d8\u91cf\u8981\u6c42\uff1a<\/p>\n
\u2460\u4e24\u53d8\u91cf\u76f8\u4e92\u72ec\u7acb<\/p>\n
\u2461\u4e24\u53d8\u91cf\u4e3a\u8fde\u7eed\u53d8\u91cf<\/p>\n
\u2462\u4e24\u53d8\u91cf\u7684\u5206\u5e03\u9075\u5faa\u6b63\u6001\u5206\u5e03<\/p>\n
\u2463\u4e24\u53d8\u91cf\u5448\u7ebf\u6027\u5173\u7cfb<\/p>\n
\u6362\u53e5\u8bdd\u6765\u8bf4\uff0c\u5f53\u4f60\u9009\u62e9\u7684\u53d8\u91cf\u7b26\u5408\u4e0a\u8981\u6c42\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u9009\u62e9\u4f7f\u7528Pearson\u76f8\u5173\u7cfb\u6570\u6765\u6c42\u4e24\u4e2a\u53d8\u91cf\u95f4\u7684\u76f8\u5173\u5173\u7cfb<\/p>\n
(2)\u6309\u7167\u4e0a\u4e00\u7bc7\u6587\u7ae0\u5bf9\u76f8\u5173\u5206\u6790\u7684\u89e3\u8bf4\uff0c\u8ba1\u7b97Pearson\u76f8\u5173\u7cfb\u6570\u7684\u65f6\u5019\uff0c\u6709\u4e24\u4e2a\u6b65\u9aa4\uff1a<\/p>\n
\u2460\u8ba1\u7b97\u76f8\u5173\u7cfb\u6570r<\/p>\n
\u2461\u8ba1\u7b97\u663e\u8457\u6027\u6c34\u5e73\u03b1<\/p>\n
\u56e0\u6b64\u8fd9\u91cc\u4f5c\u51fa\u7b80\u5355\u7684\u8bb2\u89e3\uff1a<\/p>\n
\u2460\u8ba1\u7b97\u76f8\u5173\u7cfb\u6570r<\/p>\n
Pearson\u7684\u76f8\u5173\u7cfb\u6570r\u7684\u516c\u5f0f\u4e3a\uff1a<\/p>\n
<\/p>\n
\u90a3\u4e48\u628a\u6570\u636e\u4ee3\u5165\u5230\u516c\u5f0f\u4e2d\u8ba1\u7b97<\/p>\n
#state.x77\u7b2c3\u5217\u4e3a\u6587\u76f2\u7387x <\/p>\n
2<\/p>\n
3<\/p>\n
4<\/p>\n
5<\/p>\n
6<\/p>\n
7<\/p>\n
8<\/p>\n
9<\/p>\n
10<\/p>\n
11<\/p>\n
12<\/p>\n
13<\/p>\n
14<\/p>\n
\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u6839\u636e1977\u5e74\u53d1\u5e03\u7684\u7f8e\u56fd50\u4e2a\u5dde\u7684states.x77\u6837\u672c\u4e2d\u7684\u6570\u636e\u7b97\u51fa\u4e86\u76f8\u5173\u7cfb\u6570r=-0.5884779\uff0c\u56e0\u4e3a\u6837\u672cstates.x77\u53ea\u662f\u4ece\u603b\u4f53(\u8bbe\u4e3a\u603b\u4f53A)\u62bd\u51fa\u6765\u7684\u6570\u636e(\u603b\u4f53\u5e94\u8be5\u662f\u8fd9\u4e48\u591a\u5e74\u6765\u7f8e\u56fd\u5404\u4e2a\u5dde\u7684\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u7684\u6570\u636e)\uff0c\u90a3\u4e48\u8fd9\u4e2astates.77\u6837\u672c\u4e2d\u7b97\u51fa\u7684\u76f8\u5173\u7cfb\u6570r\u5e76\u4e0d\u4e00\u5b9a\u80fd\u4ee3\u8868\u603b\u4f53A\u7684\u76f8\u5173\u7cfb\u6570\u03c1<\/p>\n
<\/p>\n
\u2461\u8ba1\u7b97\u663e\u8457\u6027\u6c34\u5e73\u03b1<\/p>\n
\u8bbe\u60f3\u4e00\u4e0b\uff0c\u5982\u679c\u6211\u4eec\u7684\u603b\u4f53A\u7684\u76f8\u5173\u7cfb\u6570\u03c1\u5b9e\u9645\u4e0a\u4e3a0\u7684(\u4e5f\u5c31\u662f\u8bf4\u603b\u4f53\u4e0a\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u6ca1\u6709\u76f8\u5173\u5173\u7cfb)\uff0c\u56e0\u4e3a\u8bef\u5dee\u6216\u8005\u62bd\u6837\u504f\u5dee\u7684\u5173\u7cfb\uff0c\u62bd\u6837\u6240\u5f97\u7684states.x77\u7684\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u6570\u636e\u8ba1\u7b97\u51fa\u6765\u7684\u76f8\u5173\u7cfb\u6570r\u5e76\u4e0d\u4e3a0(\u4e5f\u5c31\u662f\u8bf4\u6837\u672c\u4e0a\u663e\u793a\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u6709\u76f8\u5173\u5173\u7cfb)\uff0c\u56e0\u6b64\u8981\u8fdb\u884c\u663e\u8457\u6027\u68c0\u9a8c\uff1a<\/p>\n
\u63d0\u51fa\u5047\u8bbe\uff1a<\/p>\n
H0\uff1a\u603b\u4f53A\u7684\u76f8\u5173\u7cfb\u6570\u03c1=0(\u4e5f\u5c31\u662f\u8bf4\u5047\u8bbe\u603b\u4f53\u4e0a\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u6ca1\u6709\u76f8\u5173\u5173\u7cfb)<\/p>\n
H1\uff1a\u603b\u4f53A\u7684\u76f8\u5173\u7cfb\u6570\u03c1\u22600(\u4e5f\u5c31\u662f\u8bf4\u603b\u4f53\u4e0a\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u6709\u76f8\u5173\u5173\u7cfb)<\/p>\n
\u8ba1\u7b97\u68c0\u9a8c\u7684\u7edf\u8ba1\u91cf\uff1a<\/p>\n
<\/p>\n
\u67e5\u8868\u786e\u5b9a\u663e\u8457\u6027\u6c34\u5e73\u03b1<\/p>\n
\u628a\u6570\u636e\u4ee3\u5165\u516c\u5f0f\u4e2d\u8ba1\u7b97\uff1a<\/p>\n
T <\/p>\n
2<\/p>\n
3<\/p>\n
\u5f97\u51faT=-5.042706<\/p>\n
3.R\u8bed\u8a00\u5e94\u7528\u4ee5\u53ca\u89c2\u5bdf\u7ed3\u679c<\/p>\n
\u5728R\u8bed\u8a00\u4e2d\uff0c\u6709\u76f4\u63a5\u7684\u51fd\u6570cor( )\u8ba1\u7b97\u51faPearson\u76f8\u5173\u7cfb\u6570<\/p>\n
\u540c\u6837\u662f\u4e24\u4e2a\u6b65\u9aa4\uff1a<\/p>\n
\u8ba1\u7b97\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u4e4b\u95f4\u7684\u76f8\u5173\u7cfb\u6570r\uff1a<\/p>\n
r <\/p>\n
2<\/p>\n
3<\/p>\n
\u548c\u6211\u4eec\u4f7f\u7528\u8ba1\u7b97Pearson\u7cfb\u6570\u8ba1\u7b97\u51fa\u7684\u7ed3\u679c\u4e00\u81f4<\/p>\n
\u8fdb\u884c\u663e\u8457\u6027\u68c0\u9a8c<\/p>\n
#\u4f7f\u7528cor.test()\u51fd\u6570\u8ba1\u7b97\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u7684\u76f8\u5173\u5173\u7cfb\uff0c\u9ed8\u8ba4\u65b9\u6cd5\u4e3aPearson\u76f8\u5173\u5206\u6790T <\/p>\n
2<\/p>\n
3<\/p>\n
4<\/p>\n
5<\/p>\n
6<\/p>\n
7<\/p>\n
8<\/p>\n
9<\/p>\n
10<\/p>\n
11<\/p>\n
12<\/p>\n
13<\/p>\n
14<\/p>\n
15<\/p>\n
16<\/p>\n
17<\/p>\n
18<\/p>\n
19<\/p>\n
4.R\u8bed\u8a00\u6269\u5c55\u5e94\u7528<\/p>\n
\u5f53\u6211\u4eec\u4e0d\u4ec5\u4ec5\u9700\u8981\u8ba1\u7b97\u6587\u76f2\u7387\u548c\u9884\u671f\u5bff\u547d\u7684\u76f8\u5173\u5173\u7cfb\uff0c\u800c\u662f\u8ba1\u7b97state.x77\u4e2d\u5404\u4e2a\u6570\u636e\u4e4b\u95f4\u7684\u76f8\u5173\u5173\u7cfb\uff0c\u4f7f\u7528cor()\u4e5f\u662f\u53ef\u4ee5\u505a\u5230\u7684\uff1a<\/p>\n
\u518d\u6b21\u6309\u7167\u76f8\u5173\u5206\u6790\u7684\u6b65\u9aa4\uff1a<\/p>\n
\u2460\u8ba1\u7b97\u76f8\u5173\u7cfb\u6570r(\u4e24\u4e24\u53d8\u91cf\u95f4\u7684\u76f8\u5173\u7cfb\u6570)<\/p>\n
> cor(state.x77[1:6) Population Income Illiteracy Life Exp Population 1.00000000 0.2082276 0.10762237 -0.06805195 Income 0.20822756 1.0000000 -0.43707519 0.34025534 Illiteracy 0.10762237 -0.4370752 1.00000000 -0.58847793 Life Exp -0.06805195 0.3402553 -0.58847793 1.00000000 Murder 0.34364275 -0.2300776 0.70297520 -0.78084575 HS Grad -0.09848975 0.6199323 -0.65718861 0.58221620 Frost -0.33215245 0.2262822 -0.67194697 0.26206801 Area 0.02254384 0.3633154 0.07726113 -0.10733194 Murder HS Grad0.3436428 -0.09848975-0.2300776 0.619932320.7029752 -0.65718861-0.7808458 0.582216201.0000000 -0.48797102-0.4879710 1.00000000 -0.5388834 0.36677970 0.2283902 0.333541871<\/p>\n
2<\/p>\n
3<\/p>\n
4<\/p>\n
5<\/p>\n
6<\/p>\n
7<\/p>\n
8<\/p>\n
9<\/p>\n
10<\/p>\n
11<\/p>\n
12<\/p>\n
13<\/p>\n
14<\/p>\n
15<\/p>\n
16<\/p>\n
17<\/p>\n
18<\/p>\n
19<\/p>\n
\u2461\u8ba1\u7b97\u663e\u8457\u6027\u6c34\u5e73\u03b1<\/p>\n
> #\u8d4b\u503cstate.x77\u4e2d\u7b2c1\u81f36\u5217\u7684\u6570\u636e\u7ed9states> states #\u6267\u884c\u5bf9states\u4e2d\u7684\u7f3a\u5931\u503c\u8fdb\u884c\u884c\u5220\u9664\u7684\u663e\u8457\u6027\u68c0\u9a8c> corr.test(states, adjust = \"none\", use = \"complete\")Call:corr.test(x = states, use = \"complete\", adjust = \"none\")Correlation matrix #\u8fdb\u884cPearson\u76f8\u5173\u7cfb\u6570\u8ba1\u7b97 Population Income Illiteracy Life Exp Murder HS GradPopulation 1.00 0.21 0.11 -0.07 0.34 -0.10Income 0.21 1.00 -0.44 0.34 -0.23 0.62Illiteracy 0.11 -0.44 1.00 -0.59 0.70 -0.66Life Exp -0.07 0.34 -0.59 1.00 -0.78 0.58Murder 0.34 -0.23 0.70 -0.78 1.00 -0.49HS Grad -0.10 0.62 -0.66 0.58 -0.49 1.00#\u6837\u672c\u6570Sample Size [1] 50#\u8fdb\u884c\u663e\u8457\u6027\u68c0\u9a8cProbability values (Entries above the diagonal are adjusted for multiple tests.) Population Income Illiteracy Life Exp Murder HS GradPopulation 0.00 0.15 0.46 0.64 0.01 0.5Income 0.15 0.00 0.00 0.02 0.11 0.0Illiteracy 0.46 0.00 0.00 0.00 0.00 0.0Life Exp 0.64 0.02 0.00 0.00 0.00 0.0Murder 0.01 0.11 0.00 0.00 0.00 0.0HS Grad 0.50 0.00 0.00 0.00 0.00 0.0 To see confidence intervals of the correlations, print with the short=FALSE option1<\/p>\n
2<\/p>\n
3<\/p>\n
4<\/p>\n
5<\/p>\n
6<\/p>\n
7<\/p>\n
8<\/p>\n
9<\/p>\n
10<\/p>\n
11<\/p>\n
12<\/p>\n
13<\/p>\n
14<\/p>\n
15<\/p>\n
16<\/p>\n
17<\/p>\n
18<\/p>\n
19<\/p>\n
20<\/p>\n
21<\/p>\n
22<\/p>\n
23<\/p>\n
24<\/p>\n
25<\/p>\n
26<\/p>\n
27<\/p>\n
28<\/p>\n
29<\/p>\n
30<\/p>\n
\u4ece\u4ee5\u4e0a\u7ed3\u679c\u53ef\u4ee5\u770b\u51fa\uff0c\u5177\u6709\u663e\u8457\u6027\u76f8\u5173\u5173\u7cfb(\u8bbe\u663e\u8457\u6027\u6c34\u5e73\u4e3a0.05\uff0c\u5373\u8d85\u8fc795%\u7684\u6982\u7387\u6709\u76f8\u5173\u5173\u7cfb)\u7684\u4e24\u4e24\u53d8\u91cf\u6709\uff1a<\/p>\n
\u53d8\u91cf P\u503c r\u503c<\/p>\n
Population\uff0cMurder 0.01 0.34<\/p>\n
Income\uff0c Illiteracy 0.00 -0.44<\/p>\n
Income\uff0cLife Exp 0.02 0.34<\/p>\n
Income\uff0c HS Grad 0.00 0.62<\/p>\n
Illiteracy\uff0c Life Exp 0.00 -0.59<\/p>\n
Illiteracy\uff0c Murder 0.00 0.70<\/p>\n
Illiteracy\uff0c HS Grad 0.00 -0.66<\/p>\n
Life Exp\uff0c HS Grad 0.00 0.58<\/p>\n
Life Exp\uff0c Murder 0.00 -0.78<\/p>\n
Murder\uff0c HS Grad 0.00 -0.49<\/p>\n
\u514d\u8d23\u58f0\u660e\uff1a\u672c\u6587\u4ec5\u4ee3\u8868\u6587\u7ae0\u4f5c\u8005\u7684\u4e2a\u4eba\u89c2\u70b9\uff0c\u4e0e\u672c\u7ad9\u65e0\u5173\u3002\u5176\u539f\u521b\u6027\u3001\u771f\u5b9e\u6027\u4ee5\u53ca\u6587\u4e2d\u9648\u8ff0\u6587\u5b57\u548c\u5185\u5bb9\u672a\u7ecf\u672c\u7ad9\u8bc1\u5b9e\uff0c\u5bf9\u672c\u6587\u4ee5\u53ca\u5176\u4e2d\u5168\u90e8\u6216\u8005\u90e8\u5206\u5185\u5bb9\u6587\u5b57\u7684\u771f\u5b9e\u6027\u3001\u5b8c\u6574\u6027\u548c\u539f\u521b\u6027\u672c\u7ad9\u4e0d\u4f5c\u4efb\u4f55\u4fdd\u8bc1\u6216\u627f\u8bfa\uff0c\u8bf7\u8bfb\u8005\u4ec5\u4f5c\u53c2\u8003\uff0c\u5e76\u81ea\u884c\u6838\u5b9e\u76f8\u5173\u5185\u5bb9\u3002<\/p>\n
http:\/\/www.pinlue.com\/style\/images\/nopic.gif<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u76ae\u5c14\u68ee \u7edf\u8ba1\u5b66\u76f8\u5173\u6027\u5206\u6790_\u3010R\u8bed\u8a00\u3011\u8bfb\u61c2Pearson\u76f8\u5173\u5206\u6790\u7ed3\u679c\u3010R\u8bed\u8a00\u3011\u8bfb\u61c2Pearson\u76f8\u5173\u5206\u6790\u7ed3\u679c2018-09-141.\u6570\u636e\u8bf4\u660e\u8fd9\u91cc\u6211\u5bf9R...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7119"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=7119"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7119\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=7119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=7119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=7119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}