Math 3526-01 Applied Statistics II Homework 6 Due to 3/25/18 Name Score Problem
ID: 3066867 • Letter: M
Question
Math 3526-01 Applied Statistics II Homework 6 Due to 3/25/18 Name Score Problem 1. We want to test whether smokers and nonsmokers have some difference. The data is small, you can copy the data directly to R nonsmokerS c (18,22,21,17,20,17,23,20,22,21) smokers - c (16,20,14,21,20,18,13,15,17,21) a). Conduct two-samples T-test, without the assumption that the variances are equal, based on R output, make your decision. b). Conduct two-samples T-test, with the assumption that the variances are equal, based on R output, make your decision. c). Computed directly the tvalue (under the assumption of equal variance), based on the formula Problem 2.Suppose Dr. W and Dr. S both teach Math 3526. Dr. W teaches section , while Dr. S teaches section 2. The two classes use the same teaching materials and with the same exam. The following is a summary classes in a common exam Math 3526 Number of students Average sooee Standard deviation Section 1 Section 2 table for the result of the two 21 24 83.6 81.3 12.4 As you can see, the class average score for Section 1 is higher than that of Section 2. Dr. W wants to use this evidence to show his teaching is more effective than the teaching of Dr. S. At significance level 0.05, can Dr. W really says that his teaching is more effective?Explanation / Answer
R code:
smokers=c(16,20,14,21,20,18,13,15,17,21)
nonsmokers=c(18,22,21,17,20,17,23,20,22,21)
#a)
t.test(smokers,nonsmokers, var.equal=FALSE, paired=FALSE)
#b)
t.test(smokers,nonsmokers, var.equal=TRUE, paired=FALSE)
#c)
n1=length(smokers)
n2=length(nonsmokers)
s1=sd(smokers)
s2=sd(nonsmokers)
sp=sqrt(((n1-1)*(s1^2)+(n2-1)*(s2^2))/(n1+n2-2))
se=sp*sqrt(1/n1+1/n2)
m1=mean(smokers)
m2=mean(nonsmokers)
test.stat=(m1-m2)/(se)
test.stat
a)here t = -2.2573, df = 16.376, p-value = 0.03798
so p value less than level of significance Alpha=0.05 hence at 5% level of significance in the light of the given data we conclude that the two means are not equal.
b)
t = -2.2573, df = 18, p-value = 0.03665
so p value less than level of significance Alpha=0.05 hence at 5% level of significance in the light of the given data we conclude that the two means are not equal.
c) the value of the t statistic is given by: -2.257316