HW9
docx
keyboard_arrow_up
School
University of North Carolina, Chapel Hill *
*We aren’t endorsed by this school
Course
600
Subject
Industrial Engineering
Date
Dec 6, 2023
Type
docx
Pages
4
Uploaded by BaronCrownBoar30
BIOS 600 Spring 2019.
Homework 9.
Chapter 13.
Chapter 13. Exercises 13.4.
Hypotesis:
H
0
:
μ
1
=
μ
2
=
μ
3
vs.
H
a
:
At least one of the
μ
i
s differ
R code:
> group1=c(9.09,9.96,9.72,9.64,8.14)
> group2=c(10.21,10.48,13.01,12.74,12.58)
> group3=c(9.03,9.55,12.35,9.33,9.58)
> wg=stack(list('group 1'= group1, 'group 2'= group2, 'group 3'= group3))
> dt=aov(values~ind, data = wg)
> summary(dt)
Df Sum Sq Mean Sq F value Pr(>F)
ind
2
16.71
8.353
6.028 0.0154 *
Residuals
12
16.63
1.386
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
ANNOVA Table:
Sum of Squares
df
Mean Square
F
Pr(>F)
Between Groups
16.71
2
8.353
1.386
0.0154
Within Groups
16.63
12
1.386
Total
33.34
14
Statistics:
F
stat
= 1.386 with 2 (numerator) and 12 (denominator) degrees of freedom
P-value is 0.0154, providing significant evidence against the
H
0
; conclude the weight gain over 1-
month period in lab mice with different diet differed in at least one of the groups.
Results are significantly at α=0.05.
Chapter 13. Exercises 13.6.
R code:
> pairwise.t.test(values, ind, p.adj='bonf')
Pairwise comparisons using t tests with pooled SD
data:
values and ind
group 1 group 2
group 2 0.017
-
group 3 1.000
0.089
P value adjustment method: bonferroni
1.
H
0
:
μ
1
=
μ
2
versus
H
a
:
μ
1
≠ μ
2
2
P-value is 0.017, providing significant evidence against the
H
0
; conclude the weight gain over 1-
month period in lab mice on diet 1 differed from mice on diet 2.
2.
H
0
:
μ
2
=
μ
3
versus
H
a
:
μ
2
≠ μ
3
P-value is 0.089, at an alpha value of 0.05 we fail to reject the null hypothesis. There is
insufficient evidence that a weight gain difference exists between mice on diet 2 vs. mice on
diet 2.
3.
H
0
:
μ
1
=
μ
3
versus
H
a
:
μ
1
≠ μ
3
P-value is 1, at an alpha value of 0.05 we fail to reject the null hypothesis. There is insufficient
evidence that a weight gain difference exists between mice on diet 1 vs. mice on diet 3.
Chapter 13. Exercises 13.8.
Hypotheses:
H
0
:
M
1
=
M
2
=
M
3
vs.
H
a
:
at least one
M
i
differs
R code:
> kruskal.test(values~ind, data=wg)
Kruskal-Wallis rank sum test
data:
values by ind
Kruskal-Wallis chi-squared = 7.94, df = 2, p-value = 0.01887
P-value is 0.01887, providing significant evidence against the
H
0
; conclude the weight gain over
1-month period in lab mice with different diet differed in at least one of the groups.
Chapter 13. Exercises 13.10.
1. R code:
> cohort1=c(8.7,11.9,10)
> cohort2=c(1.4,1,1.3,1,1.3,2,0.6,0.8,0.7,0.9,1.9)
> cohort3=c(0.9,3.3,1.2,1.1)
> mean(cohort1)
[1] 10.2
> sd(cohort1)
[1] 1.609348
> mean(cohort2)
[1] 1.172727
> sd(cohort2)
[1] 0.460632
> mean(cohort3)
[1] 1.625
> sd(cohort3)
[1] 1.12361
3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Sample size
Mean
Standard deviation
Cohort 1
3
10.2
1.609348
Cohort 2
11
1.172727
0.460632
Cohort 3
4
1.625
1.12361
Double standard deviation benchmark: largest SD/smallest SD = 1.609348/0.460632 = 3.4938 >
2. The variances are not equal.
Hypotesis:
H
0
: σ
2
1
= σ
2
2
= σ
2
3
versus
H
a
: at least one of the variance differs
> cohort1=c(8.7,11.9,10)
> cohort2=c(1.4,1,1.3,1,1.3,2,0.6,0.8,0.7,0.9,1.9)
> cohort3=c(0.9,3.3,1.2,1.1)
> mlt=stack(list('cohort 1'=cohort1, 'cohort 2' = cohort2, 'cohort 3' = cohort3))
> leveneTest(values~ind, data=mlt)
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group
2
1.5275
0.249
15
Test statistic,
F
stat
= 1.5275 with p value = 0.249. At an alpha level of 0.05 we fail to reject the null
hypothesis. There is insufficient evidence that
the
variances differ between the 3 groups.
4