In: Statistics and Probability
A local bar wants to see if an entry fee changes how much the customers spend on drinks. On a night with a $ entry fee the average amount spent on drinks per customer for 30 customers was $9 with a standard deviation of $4.50. On a night with no entry fee the average for 40 customers was $10.50 with a standard deviation of $5.
- What is the t-statistic you would use? Use the general formula and write your final calculation
- Sketch a t-distribution, label the t-statistic and the probability you would be interested in
R commands and
outputs:
n1=30
xbar=9
sig1=4.5
n2=40
ybar=10.5
sig2=5
xbar-ybar ## Observed difference
[1] -1.5
(sig1^2/n1)+(sig2^2/n2)
[1] 1.3
sqrt((sig1^2/n1)+(sig2^2/n2)) ## Standard deviation of
difference
[1] 1.140175
t=(xbar-ybar)/sqrt((sig1^2/n1)+(sig2^2/n2))
t
[1] -1.315587
alpha=0.05
qt(1-alpha/2,df=n1+n2-2)
[1] 1.995469
## p-values are as follows:
pt(t,df=n1+n2-2)*2 ## Ha: Population 1 not = Population 2
[1] 0.1927312
pt(abs(t),df=n1+n2-2) ## Ha: Population 1 < Population
2
[1] 0.9036344
pt(t,df=n1+n2-2) ## Ha: Population 1 > Population 2
[1] 0.09636558