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.

76 第五章 图库<br />

1 > (x = margin.table(HairEyeColor, c(1, 2)))<br />

Eye<br />

Hair Brown Blue Hazel Green<br />

Black 68 20 15 5<br />

Brown 119 84 54 29<br />

Red 26 17 14 14<br />

Blond 7 94 10 16<br />

1 > assocplot(x)<br />

2 > chisq.test(x)<br />

Pearsons Chi-squared test<br />

data: x<br />

X-squared = 138.3, df = 9, p-value < 2.2e-16<br />

Eye<br />

Green Hazel Blue Brown<br />

Black Brown Red Blond<br />

Hair<br />

图 5.9: 眼睛颜色与头发颜色的关联图

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

Saved successfully!

Ooh no, something went wrong!