Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1- 6 subjects were given a drug and an additional 6 subjects a placebo. Their re

ID: 3328557 • Letter: 1

Question

1- 6 subjects were given a drug and an additional 6 subjects a placebo. Their reaction time to a stimulus was measured (in ms): placebo: 91, 87, 99, 77, 88, 91; drug: 101, 110, 103, 93, 99, 104 Perform a two sample t-test to compare the means of the two groups. By using R

2-A study was performed to test whether cars get better mileage on premium gas than on regular gas. Each of 10 cars was first filled with either regular or premium gas, decided by a coin toss, and the mileage for that tank was recorded. The mileage was recorded again for the same cars using the other kind of gasoline. Here are the results: Regular: 16, 20, 21, 22, 23, 22, 27, 25, 27, 28; premium: 19, 22, 24, 24, 25, 25, 26, 26, 28, 32 Use a paired t-test to determine whether cars get significantly better mileage with premium gas. By using R

Explanation / Answer

The hypotheses can be expressed in two different ways that express the same idea and are mathematically equivalent:

H0: µ1 = µ2 ("the paired population means are equal")
H1: µ1 µ2 ("the paired population means are not equal")

OR

H0: µ1 - µ2 = 0 ("the difference between the paired population means is equal to 0")
H1: µ1 - µ2 0 ("the difference between the paired population means is not 0")

where

R Codes

> x1=c(91,87,99,77,88,91)
> x2=c(101,110,103,93,99,104)
> t.test(x1,x2, paired=TRUE)

Paired t-test

data: x1 and x2
t = -4.9355, df = 5, p-value = 0.004339
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-19.517395 -6.149271
sample estimates:
mean of the differences
-12.83333

The p-value is less than 0.05, then we can Reject the hypothesis H0 of equality of the averages. In conclusion, the paired population means are not equal
Similarly,

R Codes for seconf problem

> a=c(16,20,21,22,23,22,27,25,27,28)
> b=c(19,22,24,24,25,25,26,26,28,32)
> t.test(a,b, paired=TRUE)

Paired t-test

data: a and b
t = -4.4721, df = 9, p-value = 0.00155
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-3.0116674 -0.9883326
sample estimates:
mean of the differences

The p-value is less than 0.05, then we can Reject the hypothesis H0 of equality of the averages. In conclusion, the paired population means are not equal
-2