02.07.2013 Views

现代统计图形 - 科学网—博客

现代统计图形 - 科学网—博客

现代统计图形 - 科学网—博客

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

70 第五章 图库<br />

1 > par(mar = c(2, 2.5, 0.2, 0.1))<br />

2 > x = rnorm(150)<br />

3 > y = rnorm(50, 0.5)<br />

4 > boxplot(list(x, y), names = c("x", "y"), col = 2:3,<br />

5 + horizontal = TRUE, notch = TRUE, varwidth = TRUE)<br />

6 > wilcox.test(x, y)<br />

Wilcoxon rank sum test with continuity correction<br />

data: x and y<br />

W = 2579, p-value = 0.0009585<br />

alternative hypothesis: true location shift is not equal to 0<br />

x y<br />

-2 -1 0 1 2 3<br />

图 5.6: 箱线图的凹槽与统计推断:从凹槽不交叠的情况来看,两样本中位<br />

数有显著差异。<br />

2 > summary(insects.aov)<br />

Df Sum Sq Mean Sq F value Pr(>F)<br />

spray 5 2669 534 34.7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!