Null and alternative hypotheses : Car model fuel usage

150 Views Asked by At

Some people assume that a specific car model does at least $\mu_0=120$ km with $1$ Lt of gasoline (petrol).

$10$ independent tests give the following results: $$104, \ 96, \ 80, \ 100, \ 108, \ 100, \ 112, \ 120, \ 130, \ 132$$

(a) Give the Null Hypothesis $H_0$ and the alternative Hypothesis $H_1$, for the test of that assumption.

(b) Give the statistic function of that test.

(c) late the p-value of the test.

(d) In what confidence level can the assumption be rejected?

$$$$

For (a) is the null hypothesis $H_0: \ m_0=120$ and the alternative $H_1: \ \mu_1\neq 120$ ?

2

There are 2 best solutions below

6
On
  • You have to assume normality

  • The Hypothesis you stated is correct

  • the test statistics is the following

$$t=\frac{\overline{X}_{10}-120}{S}\sqrt{10}\sim \mathcal{T}_{9}$$

say $t$ follows a Student T distribution with 9 d.o.f.

$S^2$ is the unbiased sample variance (to be calculated with the given data)

I think you can conclude by yourself

To calulate exactly the pvalue you need a calculator. It results to me $p_{\text{value}}\approx 4.41\%$

You can reject $H_0$ for any significance level less than $p$

0
On

The ten observations 104, 96, 80, 100, 108, 100, 112, 120, 130, 132 have mean $\bar X = 108.2,$ which is less than 120. The question is whether 108.2 is significantly smaller than 120 in a statistical sense. That is, the question whether to reject $H_0: \mu \ge 120$ in favor of $H_1: \mu < 120.$

It seems safe to assume the population from which these ten observations were taken is normal. There are not enough observations for a convincing goodness-of-fit test, but a boxplot shows no outliers and a normal probability plot is not far from linear. [Plot and test use R.]

par(mfrow=c(1,2))
 boxplot(x, col="skyblue2")
 qqnorm(x);  qqline(x, col="blue")
par(mfrow=c(1,2))

enter image description here

It seems safe to do a t.test, which gives P-value $0.02206 < 0.05 = 5\%,$ rejecting $H_0$ at the 5% level of significance. [@tommik gives the formula for the t statistic.]

t.test(x, mu=120, alt="less")

        One Sample t-test

data:  x
t = -2.3385, df = 9, p-value = 0.02206
alternative hypothesis: true mean is less than 120
95 percent confidence interval:
   -Inf 117.4499
sample estimates:
mean of x 
    108.2 

The 5% critical value for this one-sided test is $-1.833 > -2.338;$ another indication to reject at the 5% level.

The exact P-value cannot be found from printed tables, but it can be bracketed between two values (e.g., in my table between 0.01 and 0.025). A direct computation in R is shown below:

qt(.05, 9)
[1] -1.833113   # 5% left-sided critical value

pt(-2.3385, 9)
[1] 0.02206428  # consistent with output above

If you are expected to show how to compute the t statistic, determine the degrees of freedom, or find the 5% critical value of the test, I will leave that to you.

Notes on alternative methods: (1) If one questions normality, the data seem sufficiently symmetrical that one might do a one-sample Wilcoxon signed-rank test for the population median. The P-value $0.025,$ shown below indicates rejection at the 5% level, but there are warning messages that ties and a data value exactly at 120 prevent the P-value from being exact.

wilcox.test(x, mu = 120, alt="less")$p.val
[1] 0.02510388

(2) One pivot-quantile style of 95% nonparametric bootstrap one-sided CI is $(-\infty, 116.2),$ which does not include the hypothetical value $120,$ suggesting rejection of $H_0$ at the 5% level. (I say 'suggest' because ten observations may not be enough for a reliable bootstrap CI. An advantage is that the bootstrap does not assume normal data.)

a.obs = mean(x)
set.seed(225)
d.re = replicate(5000, mean(sample(x,10,rep=T)-a.obs))
L = quantile(d.re, .05)
a.obs - L
   5% 
116.2 

(3) A one-sided sign test for median 120 looks at 2 of 9 observations (different from 120) greater than 120 and gives P-value $0.0898,$ not significant at the 5% level.

pbinom(2, 9, .5)
[1] 0.08984375

Because the sign test is easy to do as above, the core of R lacks a formal sign test. Here is output from Minitab:

Sign test of median =  120.0 versus < 120.0

    N  Below  Equal  Above       P  Median
x  10      7      1      2  0.0898   106.0

Note on testing normality in small samples: With only ten observations it is difficult to judge normality using a formal test. The Shapiro-Wilk test is one of the best, but its power against (often skewed) exponential samples is only about 44% and against (often symmetrical) uniform samples only about 8%. Consequently, many statisticians prefer graphical methods (boxplots, normal probability plots) for judging normality of small samples.

set.seed(1234)
pv = replicate(10^5, shapiro.test(rexp(10))$p.val)
mean(pv <= .05)
[1] 0.4424
pv = replicate(10^5, shapiro.test(runif(10))$p.val)
mean(pv <= .05)
[1] 0.0833