找回密码
 注册
查看: 2093|回复: 0

Analysis Using R

[复制链接]
发表于 2011-3-29 01:48:11 | 显示全部楼层 |阅读模式
Weight Gain in Rats
Before applying analysis of variance to the data in Table ?? we should try to
summarise the main features of the data by calculating means and standard
deviations and by producing some hopefully informative graphs. The data is
available in the data.frame weightgain. The following R code produces the
required summary statistics
R> data("weightgain", package = "HSAUR")
R> tapply(weightgain$weightgain, list(weightgain$source,
+ weightgain$type), mean)
High Low
Beef 100.0 79.2
Cereal 85.9 83.9
R> tapply(weightgain$weightgain, list(weightgain$source,
+ weightgain$type), sd)
High Low
Beef 15.13642 13.88684
Cereal 15.02184 15.70881
To apply analysis of variance to the data we can use the aov function in R
and then the summary method to give us the usual analysis of variance table.
The model formula specifies a two-way layout with interaction terms, where
the first factor is source, and the second factor is type.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-22 01:23 , Processed in 0.023339 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表