In: Statistics and Probability
Using R to solve these questions:
1.Consider the following dataset:
fuel <- c(0.95, 0.52, 0.82, 0.89, 0.81)
The numbers correspond to the amount of fuel burnt by a new type of high-efficiency engine under a randomised test load. A value of 1 corresponds to the same fuel efficiency as the old engine, values greater than one correspond to more fuel burned (hence lower efficiency) and values less than one correspond to greater efficiency.
(a) One-sided or two-sided test? Justify.
(b) State a sensible null hypothesis (care!)
(c) Test your hypothesis using Student t test and interpret
(d) Interpret the -Inf in the confidence interval reported by R in such a way that a non statistician could understand it.
2.Here we consider the amount of data needed to perform hypothesis testing.
(a) Suppose we are testing a coin using observations of tosses. We wish to test H0 : p = 0.5 against an alternative of HA : p = 0.6 (in this question use one-sided tests only). How many tosses are needed to guarantee a size α ≤ 0.05 and β ≤ 0.2?
(b) Now generalize to consider HA : p = 0.5+δ. Choose sensible values for δ and quantify the number of observations needed as a function of δ.
Thank you so much!
> fuel <- c(0.95, 0.52, 0.82, 0.89, 0.81)
> t.test(fuel,alternative = "two.sided",mu=1,conf.level =
0.95)
One Sample t-test
data: fuel
t = -2.7302, df = 4, p-value = 0.05243
alternative hypothesis: true mean is not equal to 1
95 percent confidence interval:
0.5925806 1.0034194
sample estimates:
mean of x
0.798
(a) One-sided or two-sided test? Justify.
It's a two-sided test as there is no claim that the car is better or lesser than the old car.
(b) State a sensible null hypothesis (care!)
(c) Test your hypothesis using the Student t-test and interpret
t = -2.7302, df = 4, p-value = 0.05243
p-value >0.05 So we cannot reject the null hypothesis and conclude that the amount of fuel burnt the new type of high-efficiency engine is similar to old one.
(d) Interpret the -Inf in the confidence interval reported by R in such a way that a non-statistician could understand it.
95 per cent confidence interval: