### 技术控

今日:28| 主题:53296

# [其他] One Way Analysis of Variance Exercises

lzxohgzxf 发表于 2016-10-1 19:53:24
205 3

### 立即注册CoLaBug.com会员，免费获得投稿人的专业资料，享用更多功能，玩转个人品牌！

x
(This article was first published on R-exercises , and kindly contributed toR-bloggers)

One Way Analysis of Variance Exercises

When we are interested in finding if there is a statistical difference in the mean of two groups we use the t test. When we have more than two groups we cannot use the t test, instead we have to use analysis of variance (ANOVA). In one way ANOVA we have one continuous dependent variable and one independent grouping variable or factor. When we have two groups the t test and one way ANOVA are equivalent.
For our one way ANOVA results to be valid there are several assumptions that need to be satisfied. These assumptions are listed below.

• The dependent variable is required to be continuous
• The independent variable is required to be categorical with or more categories.
• The dependent and independent variables have values for each row of data.
• Observations in each group are independent.
• The dependent variable is approximately normally distributed in each group.
• There is approximate equality of variance in all the groups.
• We should not have any outliers
When our data shows non-normality, unequal variance or presence of outliers you can transform your data or use a non-parametric test like Kruskal-Wallis. It is good to note Kruskal-Wallis does not require normality of data but still requires equal variance in your groups.
For this exercise we will use data on patients having stomach, colon, ovary, brochus, or breast cancer. The objective of the study was to identify if the number of days a patient survived was influenced by the organ affected. Our dependent variable is Survival measured in days. Our independent variable is Organ. The data is available here http://lib.stat.cmu.edu/DASL/Datafiles/CancerSurvival.html and a cancer-survival file has been uploaded
Solutions to these exercises can be found here
Exercise 1
Load the data into R
Exercise 2
Create summary statistics for each organ
Exercise 3
Check if we have any outliers using boxplot
Exercise 4
Check for normality using Shapiro.wilk test
Exercise 5
Check for equality of variance
Exercise 6
Transform your data and check for normality and equality of variance.
Exercise 7
Run one way ANOVA test
Exercise 8
Perform a Tukey HSD post hoc test
Exercise 9
Interpret results
Exercise 10
Use a Kruskal-Wallis test

lzx0899 发表于 2016-10-13 20:07:48
 楼上的说的很多！

njhtjxx 发表于 2016-10-27 06:27:19
 人又不聪明，还学人家秃顶！！

╰素颜乜倾城° 发表于 2016-11-2 16:37:17
 别拿你的木马，挑战我的密码。

• ## 支付宝、微信们2016年支付流水竟超中国GDP

前段时间，支付宝提出 5 年进入无现金社会的口号 [...]

• ## 蚂蚁金服出售浙商银行股份 套现2.32亿元离

新浪科技讯 3月23日下午消息，港媒财华社引述 [...]

看看大洋彼岸的对手，才知道什么叫一山还有 [...]

• ## 马云手里还有两家估值超5000亿的王牌

谁会成为你之后新的世界首富?当记者问比尔·盖茨 [...]

• ## eWTP超级枢纽启动 菜鸟携中国物流集体出海

昨日，菜鸟协同我中国主要物流合作伙伴集体亮相 [...]

• ## 干货｜3分钟带你读懂ASO！运营推广小白看过

本文长度为1300字，建议阅读3分钟。 ASO是什么 [...]

• ## 蜜芽是什么？如何入驻蜜芽？

蜜芽是国内一家集亲子家庭消费和孕婴童服务于一 [...]

• ## CEO自习室:智能互联网是产业革命“催化剂”

【亿邦动力网讯】今天的热点有：中国神华去年净 [...]

• ## 微博和淘宝携手，共推网红电商平台

3月23日消息：今天，微博宣布推出网红电商平台。 [...]

• ## AptoZen加入年度退伍军人会议VETCON，帮助

AptoZen和VETCON宣布结成战略合作伙伴关系 [...]

© 2001-2017 Comsenz Inc. Design: Dean. DiscuzFans.