In: Statistics and Probability
Julie buys a take-out coffee from one of two coffee shops on a random basis: Ultimo Coffee and Joe’s Place. This month, she measured the temperature of each cup immediately after purchase, using a cooking thermometer. Sample data is shown below, temperatures are in Fahrenheit.
ultimo = c(171,161,169,179, 171,166,169,178,171, 165,172,172)
joes = c(168,165,172, 151,162,158,157,160, 158,160,158,164)
For a project, Mia is investigating whether women eat less frequently in fast-food chains than men. She asked 11 men and 11 women to keep track of how many times they ate in a fast-food restaurant in the last two months.
women = c(10,5,15,13,5, 7,18,8,19, 9, 8)
men = c(16, 9,17,14,15,11, 18,12, 37,16,30)
Expedia is investigating if the month of travel impacts the online flight ticket purchases (i.e., number of tickets purchased online via Expedia webpage during that month). The statistical analysis team collects information on number of flights booked during each month over the past 10 years and run a statistical test to test whether the average number of flight tickets purchased are same across all months or if some months are different than others.
Please answer all of them, that is the only way I can really learn and study this material. Thank you! :)
Solution-A:
Null hypopthesis:
Ho:Mu1=Mu2
the mean temperature at Ultimo Coffee and Joe’s place are same
Alternative hypothesis
Ha:Mu1 not =Mu2
the mean temperature at Ultimo Coffee and Joe’s place are different
Solution-b:
perform 2 sample indpendent t test
as samples are random and sample sizes are less than 30
and popualtion standard devaitions are not known
Solution-c:
Use t.test function in R to perform t t test and set var.equal =TRUE assuming equal variance
Rcode:
ultimo = c(171,161,169,179, 171,166,169,178,171, 165,172,172)
joes = c(168,165,172, 151,162,158,157,160,
158,160,158,164)
t.test(ultimo,joes,var.equal =TRUE)
Output:
data: ultimo and joes
t = 4.2695, df = 22, p-value = 0.0003124
alternative hypothesis: true difference in means is not equal to
0
95 percent confidence interval:
4.756911 13.743089
sample estimates:
mean of x mean of y
170.3333 161.0833
intrepretation:
t=4.2695
p=0.0003124
p<0.05
Reject Ho
Accept Ha
There is sufficient evidence at 5% level of significance to conclude that the mean temperature at Ultimo Coffee and Joe’s place are different.
What is the p value and how do you interpret its’ value in this problem?
p value=0.0003124
p value is the probability The P-value (or probability value) is
the probability of getting a sample statistic (such as
the mean) or a more extreme sample statistic in the direction of
the alternative hypothesis
when the null hypothesis is true.
here alpha=0.05
p<0.05
Reject Ho
Accept Ha
There is sufficient evidence at 5% level of significance to conclude that the mean temperature at Ultimo Coffee and Joe’s place are different.