I have given 16 random heights of random people which I know is normally distributed with unknown mean and variance.
I have to decide whether or not to accept the null hypothesis when the significance level $\alpha = 0.1$. According to my book we accept $H_0$ if $|W| = |\frac{\bar{X}-\mu_0}{S\sqrt{n}}| \leq t_{\alpha/2,n-1}$.
However, according to my professor's calculations, he has used $qt(1-\alpha/2,n-1)$, commando in R, to calculate $t_{\alpha/2,n-1}$. Why can't I use qnorm as this is normally distributed?
I also had to calculate the confidence interval where my book also says to use $t_{\alpha/2,n-1}$ but if I use this commando and not qnorm in R I get the wrong result ..
Are you able to explain why I have to use qnorm in the confidence interval and qt in the acceptance range? I literally have no idea ..
The only thing I know is that when the amount of observations is considered large we can always use qnorm in R.
Thanks.
The statistic $W:=\frac{\bar X-\mu_0}{S/\sqrt n}$ is used when the population variance $\sigma^2$ is not known. It has a $t$ distribution with $n-1$ degrees of freedom, not a normal distribution. (This is a fact you should have covered in lecture.) And for confidence intervals you should continue to use critical values from the $t(n-1)$ distribution, and not switch to the normal distribution.
OTOH, if the variance $\sigma^2$ is known, then the statistic $Z:=\frac{\bar X-\mu_0}{\sigma/\sqrt n}$ has normal distribution because we get to replace $S$ with the known $\sigma$. The normal approximation justifies using $Z$ in place of $W$ when $n$ is large.