《统计建模与R软件第七章习题(共5页).doc》由会员分享,可在线阅读,更多相关《统计建模与R软件第七章习题(共5页).doc(5页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上第七章1 a lamp lamp.aov source(anova.tab.R);anova.tab(lamp.aov) Df Sum Sq Mean Sq F value Pr(F) A 2 1304.00 652.00 4.9228 0.03595 *Residuals 9 1192.00 132.44 Total 11 2496.00 -Signif. codes: 0 * 0.001 * 0.01 * 0.05 . 0.1 . 1P值大于0.01,接受原假设。没有显著差异 b source(interval_estimatel.R) x interval_es
2、timatel(x) mean df a b1 103 3 78.04264 127.9574均值为103,区间估计为(78.04264,127.9574) source(interval_estimatel.R) x interval_estimatel(x) mean df a b1 111 3 99.59932 122.4007均值为111,区间估计为(99.59932,122.4007) source(interval_estimatel.R) x interval_estimatel(x) mean df a b1 86 3 70.08777 101.9122均值为86,区间估计为(
3、70.08777,101.9122) c pairwise.t.test(X, A, p.adjust.method = none) Pairwise comparisons using t tests with pooled SD data: X and A 1 2 2 0.351 - 3 0.066 0.013P value adjustment method: none水平均值P11031.0000.3510.06621110.3511.0000.0133860.0660.0131.000 X=c(115,116,98,83,103,107,118,116,73,89,85,97) A=
4、factor(rep(1:3,c(4,4,4) pairwise.t.test(X, A, p.adjust.method = holm) Pairwise comparisons using t tests with pooled SD data: X and A 1 2 2 0.35 - 3 0.13 0.04P value adjustment method: holm X=c(115,116,98,83,103,107,118,116,73,89,85,97) A=factor(rep(1:3,c(4,4,4) pairwise.t.test(X, A, p.adjust.method
5、 = bonferroni) Pairwise comparisons using t tests with pooled SD data: X and A 1 2 2 1.00 - 3 0.20 0.04P value adjustment method: bonferroni2 lamp lamp.aov source(anova.tab.R);anova.tab(lamp.aov) Df Sum Sq Mean Sq F value Pr(F) A 3 351.72 117.24 15.105 2.277e-05 *Residuals 20 155.23 7.76 Total 23 50
6、6.96 -Signif. codes: 0 * 0.001 * 0.01 * 0.05 . 0.1 1p值远远小于0.01,拒绝原假设。所以有显著差异3 lamp lamp.aov source(anova.tab.R);anova.tab(lamp.aov) Df Sum Sq Mean Sq F value Pr(F) A 3 351.72 117.24 15.105 2.277e-05 *Residuals 20 155.23 7.76 Total 23 506.96 -Signif. codes: 0 * 0.001 * 0.01 * 0.05 . 0.1 1 lamp attach
7、(lamp) The following object(s) are masked _by_ .GlobalEnv : A X shapiro.test(XA=1) Shapiro-Wilk normality testdata: XA = 1 W = 0.8816, p-value = 0.3456 shapiro.test(XA=2) Shapiro-Wilk normality testdata: XA = 2 W = 0.9051, p-value = 0.4567 shapiro.test(XA=3) Shapiro-Wilk normality testdata: XA = 3 W
8、 = 0.9815, p-value = 0.9109计算结果表明,在三种水平下均是正太的方差齐次性检验: bartlett.test(XA,data=lamp) Bartlett test of homogeneity of variancesdata: X by A Bartletts K-squared = 12.139, df = 2, p-value = 0.P值(0.) lamp kruskal.test(Xg,data=lamp) Kruskal-Wallis rank sum testdata: X by g Kruskal-Wallis chi-squared = 7.932
9、2, df = 2, p-value = 0.01895P值 lamp kruskal.test(Xg,data=lamp) Kruskal-Wallis rank sum testdata: X by g Kruskal-Wallis chi-squared = 0.5678, df = 3, p-value = 0.9038P值0.05,所以接受原假设。表示情绪反应力无显著差异6 out out.aov source(anova.tab.R);anova.tab(out.aov) Df Sum Sq Mean Sq F value Pr(F) a 2 3.9744 1.9872 26.694 0. *b 2 4.4411 2.2206 29.828 0. *a:b 4 21.1589 5.2897 71.056 8.337e-07 *Residuals 9 0.6700 0.0744 Total 17 30.2444 -Signif. codes: 0 * 0.001 * 0.01 * 0.05 . 0.1 1显著性水平在0.05下,压力效应是高度显著的,而温度效应及交互效应并不显著专心-专注-专业
限制150内