{"id":488,"date":"2023-07-29T18:02:44","date_gmt":"2023-07-29T18:02:44","guid":{"rendered":"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/"},"modified":"2023-07-29T18:02:44","modified_gmt":"2023-07-29T18:02:44","slug":"%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/","title":{"rendered":"\u5982\u4f55\u5728 r \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/cn\/\u53cc\u5411\u65b9\u5dee\u5206\u6790\/\" target=\"_blank\" rel=\"noopener\">\u53cc\u5411\u65b9\u5dee\u5206\u6790<\/a>\uff08\u201c\u65b9\u5dee\u5206\u6790\u201d\uff09\u7528\u4e8e\u786e\u5b9a\u8de8\u4e24\u4e2a\u56e0\u7d20\u5212\u5206\u7684\u4e09\u4e2a\u6216\u66f4\u591a\u72ec\u7acb\u7ec4\u7684\u5e73\u5747\u503c\u4e4b\u95f4\u662f\u5426\u5b58\u5728\u7edf\u8ba1\u663e\u7740\u5dee\u5f02\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u5728 R \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u793a\u4f8b\uff1aR \u4e2d\u7684\u53cc\u5411\u65b9\u5dee\u5206\u6790<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u5047\u8bbe\u6211\u4eec\u60f3\u8981\u786e\u5b9a\u8fd0\u52a8\u5f3a\u5ea6\u548c\u6027\u522b\u662f\u5426\u4f1a\u5f71\u54cd\u51cf\u80a5\u3002\u5728\u672c\u4f8b\u4e2d\uff0c\u6211\u4eec\u5173\u6ce8\u7684\u4e24\u4e2a\u56e0\u7d20\u662f<em>\u8fd0\u52a8<\/em>\u548c<em>\u6027\u522b<\/em>\uff0c\u54cd\u5e94\u53d8\u91cf\u662f<em>\u4f53\u91cd\u51cf\u8f7b\uff08<\/em>\u4ee5\u78c5\u4e3a\u5355\u4f4d\uff09\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u6765\u786e\u5b9a\u8fd0\u52a8\u548c\u6027\u522b\u662f\u5426\u5f71\u54cd\u51cf\u80a5\uff0c\u5e76\u786e\u5b9a\u8fd0\u52a8\u548c\u6027\u522b\u5bf9\u51cf\u80a5\u662f\u5426\u5b58\u5728\u4ea4\u4e92\u4f5c\u7528\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6211\u4eec\u6b63\u5728\u62db\u52df 30 \u540d\u7537\u6027\u548c 30 \u540d\u5973\u6027\u53c2\u52a0\u4e00\u9879\u5b9e\u9a8c\uff0c\u6211\u4eec\u968f\u673a\u5206\u914d\u6bcf\u4eba 10 \u4eba\uff0c\u5206\u522b\u8fdb\u884c\u4e00\u4e2a\u6708\u7684\u65e0\u8fd0\u52a8\u3001\u8f7b\u5ea6\u8fd0\u52a8\u6216\u5267\u70c8\u8fd0\u52a8\u8ba1\u5212\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u4ee5\u4e0b\u4ee3\u7801\u521b\u5efa\u6211\u4eec\u5c06\u4f7f\u7528\u7684\u6570\u636e\u6846\uff1a<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#make this example reproducible\n<\/span>set.seed(10)\n\n<span style=\"color: #008080;\">#create data frame\n<\/span>data &lt;- data.frame(gender = rep(c(\"Male\", \"Female\"), each = 30),\n                   exercise = rep(c(\"None\", \"Light\", \"Intense\"), each = 10, times = 2),\n                   weight_loss = c(runif(10, -3, 3), runif(10, 0, 5), runif(10, 5, 9),\n                                   runif(10, -4, 2), runif(10, 0, 3), runif(10, 3, 8)))\n\n<span style=\"color: #008080;\">#view first six rows of data frame\n<\/span>head(data)\n\n# gender exercise weight_loss\n#1 Male None 0.04486922\n#2 Male None -1.15938896\n#3 Male None -0.43855400\n#4 Male None 1.15861249\n#5 Male None -2.48918419\n#6 Male None -1.64738030\n\n<span style=\"color: #008080;\">#see how many participants are in each group<\/span>\ntable(data$gender, data$exercise)\n\n# Intense Light None\n# Female 10 10 10\n# Male 10 10 10\n<\/strong><\/pre>\n<h3><span style=\"color: #000000;\"><strong>\u63a2\u7d22\u6570\u636e<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u5728\u62df\u5408\u53cc\u5411\u65b9\u5dee\u5206\u6790\u6a21\u578b\u4e4b\u524d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528<strong>dplyr<\/strong>\u5305\u67e5\u627e\u516d\u4e2a\u6cbb\u7597\u7ec4\u4e2d\u6bcf\u4e2a\u7ec4\u7684\u4f53\u91cd\u51cf\u8f7b\u5e73\u5747\u503c\u548c\u6807\u51c6\u5dee\u6765\u66f4\u597d\u5730\u7406\u89e3\u6570\u636e\uff1a<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#load <em>dplyr<\/em> package<\/span>\nlibrary(dplyr)\n\n<span style=\"color: #008080;\">#find mean and standard deviation of weight loss for each treatment group<\/span>\ndata %&gt;%\n  <span style=\"color: #800080;\">group_by<\/span> (gender, exercise) %&gt;%\n  <span style=\"color: #800080;\">summarize<\/span> (mean = mean(weight_loss),\n            sd = sd(weight_loss))\n\n# A tibble: 6 x 4\n# Groups: gender [2]\n# gender exercise means sd\n#          \n#1 Female Intense 5.31 1.02 \n#2 Female Light 0.920 0.835\n#3 Female None -0.501 1.77 \n#4 Male Intense 7.37 0.928\n#5 Male Light 2.13 1.22 \n#6 Male None -0.698 1.12 \n<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u6211\u4eec\u8fd8\u53ef\u4ee5\u4e3a\u516d\u4e2a\u6cbb\u7597\u7ec4\u4e2d\u7684\u6bcf\u4e00\u4e2a\u521b\u5efa\u4e00\u4e2a<a href=\"https:\/\/statorials.org\/cn\/\u7edf\u8ba1\u5b66\u4ee5\u7b80\u5355\u76f4\u63a5\u7684\u65b9\u5f0f\u89e3\u91ca\u6982\u5ff5\uff0c\u6211\u4eec\u4f7f\u5b66\u4e60\u7edf\u8ba1\u53d8\u5f97\u66f4\u5bb9\u6613\/\" target=\"_blank\" rel=\"noopener\">\u7bb1\u7ebf\u56fe<\/a>\uff0c\u4ee5\u53ef\u89c6\u5316\u6bcf\u7ec4\u7684\u4f53\u91cd\u51cf\u8f7b\u5206\u5e03\uff1a<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#set margins so that axis labels on boxplot don't get cut off<\/span>\nby(mar=c(8, 4.1, 4.1, 2.1))\n\n<span style=\"color: #008080;\">#create boxplots\n<\/span>boxplot(weight_loss ~ gender:exercise,\ndata = data,\nmain = \"Weight Loss Distribution by Group\",\nxlab = \"Group\",\nylab = \"Weight Loss\",\ncol = \"steelblue\",\nborder = \"black\", \nlas = 2 <span style=\"color: #008080;\">#make x-axis labels perpendicular<\/span>\n)<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u6211\u4eec\u7acb\u5373\u53ef\u4ee5\u770b\u5230\uff0c\u53c2\u52a0<em>\u5267\u70c8<\/em>\u8fd0\u52a8\u7684\u4e24\u7ec4\u4f3c\u4e4e\u90fd\u6709\u66f4\u9ad8\u7684\u51cf\u80a5\u503c\u3002\u6211\u4eec\u8fd8\u53ef\u4ee5\u770b\u5230\uff0c\u65e0\u8bba\u662f<em>\u5267\u70c8<\/em>\u8fd0\u52a8\u7ec4\u8fd8\u662f<em>\u8f7b\u5ea6<\/em>\u8fd0\u52a8\u7ec4\uff0c\u7537\u6027\u7684\u51cf\u80a5\u503c\u5f80\u5f80\u9ad8\u4e8e\u5973\u6027\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u53cc\u5411\u65b9\u5dee\u5206\u6790\u6a21\u578b\u4e0e\u6211\u4eec\u7684\u6570\u636e\u8fdb\u884c\u62df\u5408\uff0c\u770b\u770b\u8fd9\u4e9b\u89c6\u89c9\u5dee\u5f02\u5b9e\u9645\u4e0a\u662f\u5426\u5177\u6709\u7edf\u8ba1\u663e\u7740\u6027\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u62df\u5408\u53cc\u5411\u65b9\u5dee\u5206\u6790\u6a21\u578b<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u5728 R \u4e2d\u62df\u5408\u53cc\u5411\u65b9\u5dee\u5206\u6790\u6a21\u578b\u7684\u4e00\u822c\u8bed\u6cd5\u662f\uff1a<\/span><\/p>\n<p style=\"text-align: left;\"> <strong><span style=\"color: #000000;\">aov(\u54cd\u5e94\u53d8\u91cf ~predictor_variable1 *predictor_variable2, data = \u6570\u636e\u96c6)<\/span><\/strong><\/p>\n<p><span style=\"color: #000000;\">\u8bf7\u6ce8\u610f\uff0c\u4e24\u4e2a\u9884\u6d4b\u53d8\u91cf\u4e4b\u95f4\u7684<strong>*<\/strong>\u8868\u793a\u6211\u4eec\u8fd8\u60f3\u6d4b\u8bd5\u4e24\u4e2a\u9884\u6d4b\u53d8\u91cf\u4e4b\u95f4\u7684\u4ea4\u4e92\u4f5c\u7528\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u5728\u6211\u4eec\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u6765\u62df\u5408\u53cc\u5411\u65b9\u5dee\u5206\u6790\u6a21\u578b\uff0c\u4f7f\u7528<em>weight_loss<\/em>\u4f5c\u4e3a\u54cd\u5e94\u53d8\u91cf\uff0c\u4f7f\u7528<em>\u6027\u522b<\/em>\u548c<em>\u953b\u70bc<\/em>\u4f5c\u4e3a\u4e24\u4e2a\u9884\u6d4b\u53d8\u91cf\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<strong>summary()<\/strong>\u51fd\u6570\u6765\u663e\u793a\u6a21\u578b\u7684\u7ed3\u679c\uff1a<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#fit the two-way ANOVA model<\/span>\nmodel &lt;- aov(weight_loss ~ gender * exercise, data = data)\n\n<span style=\"color: #008080;\">#view the model output<\/span>\nsummary(model)\n\n# Df Sum Sq Mean Sq F value Pr(&gt;F)    \n#gender 1 15.8 15.80 11.197 0.0015 ** \n#exercise 2 505.6 252.78 179.087 &lt;2e-16 ***\n#gender:exercise 2 13.0 6.51 4.615 0.0141 *  \n#Residuals 54 76.2 1.41                   \n#---\n#Significant. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u4ece\u6a21\u578b\u7ed3\u679c\u4e2d\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c<em>\u6027\u522b<\/em>\u3001<em>\u8fd0\u52a8<\/em>\u4ee5\u53ca\u4e24\u4e2a\u53d8\u91cf\u4e4b\u95f4\u7684\u4ea4\u4e92\u4f5c\u7528\u5728 0.05 \u663e\u7740\u6027\u6c34\u5e73\u4e0a\u5747\u5177\u6709\u7edf\u8ba1\u663e\u7740\u6027\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u68c0\u67e5\u6a21\u578b\u5047\u8bbe<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u5728\u8fdb\u4e00\u6b65\u8fdb\u884c\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u9a8c\u8bc1\u6a21\u578b\u7684\u5047\u8bbe\u662f\u5426\u5f97\u5230\u6ee1\u8db3\uff0c\u4ee5\u4fbf\u6a21\u578b\u7ed3\u679c\u53ef\u9760\u3002\u7279\u522b\u662f\uff0c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u5047\u8bbe\uff1a<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>1. \u72ec\u7acb\u6027<\/strong>\u2014\u2014\u6bcf\u7ec4\u7684\u89c2\u5bdf\u7ed3\u679c\u5fc5\u987b\u76f8\u4e92\u72ec\u7acb\u3002\u7531\u4e8e\u6211\u4eec\u91c7\u7528\u7684\u662f<\/span>\u968f\u673a\u8bbe\u8ba1<span style=\"color: #000000;\">\uff0c\u6240\u4ee5\u8fd9\u4e2a\u5047\u8bbe\u5e94\u8be5\u662f\u6ee1\u8db3\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u4e0d\u5fc5\u592a\u62c5\u5fc3\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>2. \u6b63\u6001\u6027<\/strong>\u2014\u2014\u5bf9\u4e8e\u4e24\u4e2a\u56e0\u7d20\u7ec4\u7684\u6bcf\u4e2a\u7ec4\u5408\uff0c\u56e0\u53d8\u91cf\u5e94\u5177\u6709\u8fd1\u4f3c\u6b63\u6001\u5206\u5e03\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6d4b\u8bd5\u6b64\u5047\u8bbe\u7684\u4e00\u79cd\u65b9\u6cd5\u662f\u521b\u5efa\u6a21\u578b\u6b8b\u5dee\u7684\u76f4\u65b9\u56fe\u3002\u5982\u679c\u6b8b\u5dee\u8fd1\u4f3c\u6b63\u6001\u5206\u5e03\uff0c\u5219\u5e94\u6ee1\u8db3\u8be5\u5047\u8bbe\u3002<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <span style=\"color: #008080;\"><b>#define model residuals\n<\/b><\/span><strong>reside &lt;- model$residuals<\/strong>\n\n<span style=\"color: #008080;\"><strong>#create histogram of residuals<\/strong><\/span>\n<strong>hist(resid, main = \"Histogram of Residuals\", xlab = \"Residuals\", col = \"steelblue\")<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u6b8b\u5dee\u8fd1\u4f3c\u6b63\u6001\u5206\u5e03\uff0c\u56e0\u6b64\u6211\u4eec\u53ef\u4ee5\u5047\u8bbe\u6ee1\u8db3\u6b63\u6001\u6027\u5047\u8bbe\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>3. \u65b9\u5dee\u76f8\u7b49<\/strong>\u2014\u2014\u6bcf\u7ec4\u7684\u65b9\u5dee\u76f8\u7b49\u6216\u8fd1\u4f3c\u76f8\u7b49\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u68c0\u67e5\u6b64\u5047\u8bbe\u7684\u4e00\u79cd\u65b9\u6cd5\u662f\u4f7f\u7528<strong>car<\/strong>\u5305\u6267\u884c Levene \u65b9\u5dee\u9f50\u6027\u68c0\u9a8c\uff1a<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#load <em>car<\/em> package<\/span>\nlibrary(car)\n\n<span style=\"color: #008080;\">#conduct Levene's Test for equality of variances<\/span>\nleveneTest(weight_loss ~ gender * exercise, data = data)\n\n#Levene's Test for Homogeneity of Variance (center = median)\n# Df F value Pr(&gt;F)\n#group 5 1.8547 0.1177\n#54  \n<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u7531\u4e8e\u68c0\u9a8c\u7684 p \u503c\u5927\u4e8e\u6211\u4eec\u7684\u663e\u7740\u6027\u6c34\u5e73 0.05\uff0c\u56e0\u6b64\u6211\u4eec\u53ef\u4ee5\u5047\u8bbe\u6ee1\u8db3\u7ec4\u95f4\u65b9\u5dee\u76f8\u7b49\u7684\u5047\u8bbe\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u5206\u6790\u6cbb\u7597\u5dee\u5f02<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u4e00\u65e6\u6211\u4eec\u9a8c\u8bc1\u4e86\u6a21\u578b\u5047\u8bbe\u5f97\u5230\u6ee1\u8db3\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u8fdb\u884c<a href=\"https:\/\/statorials.org\/cn\/\u7edf\u8ba1\u5b66\u4ee5\u7b80\u5355\u76f4\u63a5\u7684\u65b9\u5f0f\u89e3\u91ca\u6982\u5ff5\uff0c\u6211\u4eec\u4f7f\u5b66\u4e60\u7edf\u8ba1\u53d8\u5f97\u66f4\u5bb9\u6613\/\" target=\"_blank\" rel=\"noopener\">\u4e8b\u540e\u6d4b\u8bd5<\/a>\u6765\u51c6\u786e\u786e\u5b9a\u54ea\u4e9b\u6cbb\u7597\u7ec4\u5f7c\u6b64\u4e0d\u540c\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u5bf9\u4e8e\u6211\u4eec\u7684\u4e8b\u540e\u6d4b\u8bd5\uff0c\u6211\u4eec\u5c06\u4f7f\u7528<strong>TukeyHSD()<\/strong>\u51fd\u6570\u6267\u884c Tukey \u6d4b\u8bd5\u4ee5\u8fdb\u884c\u591a\u91cd\u6bd4\u8f83\uff1a<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#perform Tukey's Test for multiple comparisons\n<\/span>TukeyHSD(model, conf.level=.95) \n\n#Tukey multiple comparisons of means\n# 95% family-wise confidence level\n#\n#Fit: aov(formula = weight_loss ~ gender * exercise, data = data)\n#\n#$gender\n# diff lwr upr p adj\n#Male-Female 1.026456 0.4114451 1.641467 0.0014967\n#\n#$exercise\n# diff lwr upr p adj\n#Light-Intense -4.813064 -5.718493 -3.907635 0.0e+00\n#None-Intense -6.938966 -7.844395 -6.033537 0.0e+00\n#None-Light -2.125902 -3.031331 -1.220473 1.8e-06\n#\n#$`gender:exercise`\n# diff lwr upr p adj\n#Male:Intense-Female:Intense 2.0628297 0.4930588 3.63260067 0.0036746\n#Female:Light-Female:Intense -4.3883563 -5.9581272 -2.81858535 0.0000000\n#Male:Light-Female:Intense -3.1749419 -4.7447128 -1.60517092 0.0000027\n#Female:None-Female:Intense -5.8091131 -7.3788841 -4.23934219 0.0000000\n#Male:None-Female:Intense -6.0059891 -7.5757600 -4.43621813 0.0000000\n#Female:Light-Male:Intense -6.4511860 -8.0209570 -4.88141508 0.0000000\n#Male:Light-Male:Intense -5.2377716 -6.8075425 -3.66800066 0.0000000\n#Female:None-Male:Intense -7.8719429 -9.4417138 -6.30217192 0.0000000\n#Male:None-Male:Intense -8.0688188 -9.6385897 -6.49904786 0.0000000\n#Male:Light-Female:Light 1.2134144 -0.3563565 2.78318536 0.2185439\n#Female:None-Female:Light -1.4207568 -2.9905278 0.14901410 0.0974193\n#Male:None-Female:Light -1.6176328 -3.1874037 -0.04786184 0.0398106\n#Female:None-Male:Light -2.6341713 -4.2039422 -1.06440032 0.0001050\n#Male:None-Male:Light -2.8310472 -4.4008181 -1.26127627 0.0000284\n#Male:None-Female:None -0.1968759 -1.7666469 1.37289500 0.9990364<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">p \u503c\u8868\u793a\u6bcf\u7ec4\u4e4b\u95f4\u662f\u5426\u5b58\u5728\u7edf\u8ba1\u663e\u7740\u5dee\u5f02\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u4f8b\u5982\uff0c\u5728\u4e0a\u9762\u7684\u6700\u540e\u4e00\u884c\u4e2d\uff0c\u6211\u4eec\u770b\u5230\uff0c\u4e0e\u4e0d\u8fd0\u52a8\u7684\u5973\u6027\u7ec4\u76f8\u6bd4\uff0c\u4e0d\u8fd0\u52a8\u7684\u7537\u6027\u7ec4\u5728\u4f53\u91cd\u51cf\u8f7b\u65b9\u9762\u6ca1\u6709\u51fa\u73b0\u7edf\u8ba1\u5b66\u4e0a\u7684\u663e\u7740\u5dee\u5f02\uff08p \u503c\uff1a0.990364\uff09\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6211\u4eec\u8fd8\u53ef\u4ee5\u4f7f\u7528 R \u4e2d\u7684<strong>plot()<\/strong>\u51fd\u6570\u53ef\u89c6\u5316 Tukey \u6d4b\u8bd5\u4ea7\u751f\u7684 95% \u7f6e\u4fe1\u533a\u95f4\uff1a<\/span><\/p>\n<pre style=\"background-color: #e5e5e5; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#set axis margins so labels don't get cut off\n<\/span>by(mar=c(4.1, 13, 4.1, 2.1))\n\n<span style=\"color: #008080;\">#create confidence interval for each comparison\n<\/span>plot(TukeyHSD(model, conf.level=.95), las = 2)\n<\/strong><\/pre>\n<h3><strong><span style=\"color: #000000;\">\u62a5\u544a\u53cc\u5411\u65b9\u5dee\u5206\u6790\u7ed3\u679c<\/span><\/strong><\/h3>\n<p><span style=\"color: #000000;\">\u6700\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u603b\u7ed3\u7ed3\u679c\u7684\u65b9\u5f0f\u62a5\u544a\u53cc\u5411\u65b9\u5dee\u5206\u6790\u7684\u7ed3\u679c\uff1a<\/span><\/p>\n<p><span style=\"color: #000000;\">\u8fdb\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u6765\u68c0\u67e5\u6027\u522b\uff08<em>\u7537\u6027\u3001\u5973\u6027\uff09<\/em>\u548c\u8fd0\u52a8\u8ba1\u5212<em>\uff08\u65e0\u3001\u8f7b\u5ea6\u3001\u5267\u70c8\uff09<\/em>\u5bf9\u4f53\u91cd\u51cf\u8f7b<em>\uff08\u4ee5\u78c5\u4e3a\u5355\u4f4d\uff09\u7684\u5f71\u54cd\u3002<\/em>\u6027\u522b\u548c\u8fd0\u52a8\u5bf9\u51cf\u80a5\u7684\u5f71\u54cd\u4e4b\u95f4\u5b58\u5728\u7edf\u8ba1\u5b66\u4e0a\u663e\u7740\u7684\u4ea4\u4e92\u4f5c\u7528\uff08F(2, 54) = 4.615\uff0cp = 0.0141\uff09\u3002<\/span><span style=\"color: #000000;\">\u8fdb\u884c\u4e8b\u540e Tukey \u7684 HSD \u6d4b\u8bd5\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u5bf9\u4e8e\u7537\u6027\u6765\u8bf4\uff0c<em>\u5267\u70c8<\/em>\u8fd0\u52a8\u8ba1\u5212\u6bd4<em>\u8f7b\u5ea6<\/em>\u8fd0\u52a8\u8ba1\u5212 (p &lt; 0.0001) \u6216<em>\u65e0\u8fd0\u52a8\u8ba1\u5212<\/em>(p &lt; 0.0001) \u80fd\u663e\u7740\u51cf\u8f7b\u4f53\u91cd\u3002\u6b64\u5916\uff0c\u5bf9\u4e8e\u7537\u6027\u6765\u8bf4\uff0c<em>\u6e05\u6de1<\/em>\u996e\u98df\u6bd4<em>\u4e0d\u8fd0\u52a8\u7684<\/em>\u51cf\u80a5\u6548\u679c\u663e\u7740\u66f4\u5927\uff08p &lt; 0.0001\uff09\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u5bf9\u4e8e\u5973\u6027\u6765\u8bf4\uff0c<em>\u5267\u70c8<\/em>\u8fd0\u52a8\u8ba1\u5212\u6bd4<em>\u8f7b\u5ea6<\/em>\u8fd0\u52a8\u8ba1\u5212 (p &lt; 0.0001) \u6216<em>\u65e0\u8fd0\u52a8\u8ba1\u5212<\/em>(p &lt; 0.0001) \u5e26\u6765\u7684\u51cf\u80a5\u6548\u679c\u663e\u7740\u66f4\u5927\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u8fdb\u884c\u6b63\u6001\u6027\u68c0\u67e5\u548c Levene \u68c0\u9a8c\u4ee5\u9a8c\u8bc1\u65b9\u5dee\u5206\u6790\u7684\u5047\u8bbe\u662f\u5426\u5f97\u5230\u6ee1\u8db3\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53cc\u5411\u65b9\u5dee\u5206\u6790\uff08\u201c\u65b9\u5dee\u5206\u6790\u201d\uff09\u7528\u4e8e\u786e\u5b9a\u8de8\u4e24\u4e2a\u56e0\u7d20\u5212\u5206\u7684\u4e09\u4e2a\u6216\u66f4\u591a\u72ec\u7acb\u7ec4\u7684\u5e73\u5747\u503c\u4e4b\u95f4\u662f\u5426\u5b58\u5728\u7edf\u8ba1\u663e\u7740\u5dee\u5f02\u3002 \u672c\u6559\u7a0b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-488","post","type-post","status-publish","format-standard","hentry","category-11"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u5728 R \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790 - Statorials<\/title>\n<meta name=\"description\" content=\"\u672c\u6559\u7a0b\u89e3\u91ca\u4e86\u5982\u4f55\u5728 R \u4e2d\u8f7b\u677e\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/cn\/\u4e24\u56e0\u7d20\u65b9\u5dee\u5206\u6790\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u5728 R \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790 - Statorials\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6559\u7a0b\u89e3\u91ca\u4e86\u5982\u4f55\u5728 R \u4e2d\u8f7b\u677e\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/cn\/\u4e24\u56e0\u7d20\u65b9\u5dee\u5206\u6790\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-29T18:02:44+00:00\" \/>\n<meta name=\"author\" content=\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/\",\"url\":\"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/\",\"name\":\"\u5982\u4f55\u5728 R \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790 - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/cn\/#website\"},\"datePublished\":\"2023-07-29T18:02:44+00:00\",\"dateModified\":\"2023-07-29T18:02:44+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261\"},\"description\":\"\u672c\u6559\u7a0b\u89e3\u91ca\u4e86\u5982\u4f55\u5728 R \u4e2d\u8f7b\u677e\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/statorials.org\/cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u5728 r \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/cn\/#website\",\"url\":\"https:\/\/statorials.org\/cn\/\",\"name\":\"Statorials\",\"description\":\"\u60a8\u7684\u7edf\u8ba1\u7d20\u517b\u6307\u5357\uff01\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261\",\"name\":\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\"},\"description\":\"\u5927\u5bb6\u597d\uff0c\u6211\u662f\u672c\u6770\u660e\uff0c\u4e00\u4f4d\u9000\u4f11\u7684\u7edf\u8ba1\u5b66\u6559\u6388\uff0c\u540e\u6765\u6210\u4e3a Statorials \u7684\u70ed\u5fc3\u6559\u5e08\u3002 \u51ed\u501f\u5728\u7edf\u8ba1\u9886\u57df\u7684\u4e30\u5bcc\u7ecf\u9a8c\u548c\u4e13\u4e1a\u77e5\u8bc6\uff0c\u6211\u6e34\u671b\u5206\u4eab\u6211\u7684\u77e5\u8bc6\uff0c\u901a\u8fc7 Statorials \u589e\u5f3a\u5b66\u751f\u7684\u80fd\u529b\u3002\u4e86\u89e3\u66f4\u591a\",\"sameAs\":[\"https:\/\/statorials.org\/cn\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u5728 R \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790 - Statorials","description":"\u672c\u6559\u7a0b\u89e3\u91ca\u4e86\u5982\u4f55\u5728 R \u4e2d\u8f7b\u677e\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/cn\/\u4e24\u56e0\u7d20\u65b9\u5dee\u5206\u6790\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u5728 R \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790 - Statorials","og_description":"\u672c\u6559\u7a0b\u89e3\u91ca\u4e86\u5982\u4f55\u5728 R \u4e2d\u8f7b\u677e\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u3002","og_url":"https:\/\/statorials.org\/cn\/\u4e24\u56e0\u7d20\u65b9\u5dee\u5206\u6790\/","og_site_name":"Statorials","article_published_time":"2023-07-29T18:02:44+00:00","author":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/","url":"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/","name":"\u5982\u4f55\u5728 R \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790 - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/cn\/#website"},"datePublished":"2023-07-29T18:02:44+00:00","dateModified":"2023-07-29T18:02:44+00:00","author":{"@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261"},"description":"\u672c\u6559\u7a0b\u89e3\u91ca\u4e86\u5982\u4f55\u5728 R \u4e2d\u8f7b\u677e\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790\u3002","breadcrumb":{"@id":"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/cn\/%e4%b8%a4%e5%9b%a0%e7%b4%a0%e6%96%b9%e5%b7%ae%e5%88%86%e6%9e%90\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/statorials.org\/cn\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u5728 r \u4e2d\u6267\u884c\u53cc\u5411\u65b9\u5dee\u5206\u6790"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/cn\/#website","url":"https:\/\/statorials.org\/cn\/","name":"Statorials","description":"\u60a8\u7684\u7edf\u8ba1\u7d20\u517b\u6307\u5357\uff01","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261","name":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a"},"description":"\u5927\u5bb6\u597d\uff0c\u6211\u662f\u672c\u6770\u660e\uff0c\u4e00\u4f4d\u9000\u4f11\u7684\u7edf\u8ba1\u5b66\u6559\u6388\uff0c\u540e\u6765\u6210\u4e3a Statorials \u7684\u70ed\u5fc3\u6559\u5e08\u3002 \u51ed\u501f\u5728\u7edf\u8ba1\u9886\u57df\u7684\u4e30\u5bcc\u7ecf\u9a8c\u548c\u4e13\u4e1a\u77e5\u8bc6\uff0c\u6211\u6e34\u671b\u5206\u4eab\u6211\u7684\u77e5\u8bc6\uff0c\u901a\u8fc7 Statorials \u589e\u5f3a\u5b66\u751f\u7684\u80fd\u529b\u3002\u4e86\u89e3\u66f4\u591a","sameAs":["https:\/\/statorials.org\/cn"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts\/488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/comments?post=488"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts\/488\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/media?parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/categories?post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/tags?post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}