WRITTEN ASSIGNMENT UNIT 6 SUBMISSION
1. The distribution is More symmetric.
> transfusion plot(frequency~march2007,data=transfusion)
> plot(log(frequency)~march2007,data=transfusion)
2. First case: The computed p-val
...
WRITTEN ASSIGNMENT UNIT 6 SUBMISSION
1. The distribution is More symmetric.
> transfusion<- read.csv(file.choose(), header=T)
> plot(frequency~march2007,data=transfusion)
> plot(log(frequency)~march2007,data=transfusion)
2. First case: The computed p-value is = 4.174e-06.Consequently the null hypothesis is
rejected at significance level
> t.test(frequency~march2007,data=transfusion)
Welch Two Sample t-test
data: frequency by march2007
t = -4.7229, df = 216.86, p-value = 4.174e-06
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-4.246285 -1.745712
sample estimates:
mean in group no mean in group yes
4.801754 7.797753
> t.test(log(frequency)~march2007,data=transfusion)
Welch Two Sample t-test
data: log(frequency) by march2007
t = -6.1571, df = 289.04, p-value = 2.472e-09
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.6316889 -0.3256582
sample estimates:
mean in group no mean in group yes
1.178089 1.656762
3. 3. Mark the null hypotheses that you reject with a significance level of 5% and
those that you do not reject:
(Reject/Don't Reject) H0: The variance of "frequency" is the same in the two
subsets,
(Reject/Don't Reject) H0: The variance of "log(frequency)" is the same in the
two subsets.
Explain your answer:
The function “var.test” is applied in order to test the null hypothesis.
First case: The computed p-value is = 2.2e-16. Consequently the null
hypothesis is rejected at significance level of 5%.
> var.test(frequency~march2007,data=transfusion)
F test to compare two variances
data: frequency by march2007
F = 0.34883, num df = 569, denom df = 177, p-value < 2.2e-16
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.2725525 0.4397267
sample estimates:
ratio of variances
0.3488348
Second case: The computed p-value is: 0.6249. Consequently the null
hypothesis is not rejected at significance level of 5%.
> var.test(log(frequency)~march2007,data=transfusion)
F test to compare two variances
data: log(frequency) by march2007
F = 0.9449, num df = 569, denom df = 177, p-value = 0.6249
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence in
[Show More]