PROBLEM
The life in hours of a battery is known to be approximately normally distributed with standard deviation σ = 1.25 hours. A random sample of 10 batteries has a mean life of \(\bar{x}\) = 40.5 hours.
ANSWER TO A
We may solve this problem through a seven-step procedure:
The parameter of interest is the μ, the mean battery life.
\(H_0:\ \mu=40\) hours
\(H_1:\ \mu>40\) hours
The test statistic is:
\(z_0=\frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}}\)
Reject \(H_0\) if p-value is less than 0.05. To use a fixed significance level test, the boundary of the critical region would be \(z_\alpha=\ z_{0.05}\) = 1.64.Reject \(H_0\) if \({z_0>z}_\alpha\).
The Z-statistic:
1. Manual Computation
Since \(\bar{x}\ =\ 40.5\) hours,\(\mu_0\ =\ 40\) hours, n = 10, and \(\sigma=1.25\)
\(z_0=\frac{40.5-40}{1.25/\sqrt{10}}\)
\(z_0=1.26\)
2. R Computation
#z-statistic
z_stat <- (40.5 - 40) / (1.25 / sqrt(10))
z_stat
## [1] 1.264911
The P-value:
1. Manual Computation
\(P=\ 1-\ \phi(z_0)\)
\(P=\ 1-\ \phi(1.26)\)
\(P=1-0.89617\)
\(P=1-0.89617\)
\(P=0.10383\)
2. R Computation
#p-value
(1-pnorm(1.26))
## [1] 0.1038347
Graph 1. P-Value = 0.10383
Fixed Significance Level Test:
\(z_\alpha=1.64\)
\(z_0=1.26\)
Critical Region: \((1.64,\ \infty)\)
Graph 2. Critical Region: z-score > 1.64
CONFIDENCE BOUND AND INTERVAL FOR THE μ, THE MEAN BATTERY LIFE. :
1. Manual Computation
\(CB\ =\ \bar{x}+\ z_\alpha(\sigma/\sqrt{n})\)
\(CB\ =\ 40.5+\ 1.64(1.25/\sqrt{10})\)
\(CB=40.5+1.64\left(1.25/\sqrt{10}\right)\)
\(CB\ =\ 41.148\)
The 95% One-Sided Confidence interval:
\(\ \mu\ \le\ 41.148\)
2. R Computation
#confidence-bound
sd <- 1.25 #standard deviation
sd
## [1] 1.25
za <- qnorm(p=0.05, lower.tail=FALSE)
c<- round (za,2)
x <- 40.5 #sample mean
n <- 10 #sample size
ME <- c * (sd / sqrt(n)) #margin of error
CB <- x + ME
CB
## [1] 41.14827
At 0.05 level of significance, we failed to reject the \(H_0\): μ = 40 hours, since the computed p-value, 0.1038 is greater than 0.05. Furthermore, the computed z-statistic \((z_0)\), which is 1.26, is less than the critical value (\(z_\alpha\)) of the upper-tailed test, that is 1.64. This means that our z-statistic did not fall in the rejection region \((1.64,\ \infty)\).
The 95% one-sided confidence interval for the population mean of battery life is \(\mu\ \le\ 41.148\). Since the value \(\mu_0\ =\ 40\) is included in this interval, we failed to reject the null hypothesis: \(H_0\): μ = 40 hours.
Failing to reject the null hypothesis means we do not have strong evidence to support the claim that the battery life exceeds 40 hours. We can only conclude that based on a random sample of 10 batteries and significance level of 0.05, the sample mean battery life of 40.5 hours doesn’t not differ from 40 hours.
ANSWER TO B
The P-value serves as evidence against a null hypothesis. When the p value is relatively smaller, it means that the evidence to reject the null hypothesis is stronger.
In an upper-tailed test, the p-value is the total region to the right of our computed z-statistic. Our computed z-statistic is positive. Hence the formula is the difference of 1 and the total region to the left of our computed z-statistic.
#z-statistic
z_stat <- (40.5 - 40) / (1.25 / sqrt(10))
z_stat
## [1] 1.264911
\(z_0=1.26\)
The P-value:
1. Manual Computation
\(P=\ 1-\ \phi(z_0)\)
\(P=\ 1-\ \phi(1.26)\)
\(P=1-0.89617\)
\(P=0.10383\)
2. R Computation
#p-value
(1-pnorm(1.26))
## [1] 0.1038347
Graph 1. P-Value = 0.10383
The computed p-value is 0.10383. This practically means that there’s a 10.38% probability that we will obtain a sample mean battery life of 40.5 hours if the null population mean of battery life (that is 40 hours) is true. This probability is higher compared to the standard 5% level of significance. This means that our observed sample mean, which is 40.5 hours, is not significantly different from the population mean in null hypothesis, which is μ = 40 hours. Hence, we failed to reject the null hypothesis.
ANSWER TO C
The Beta error refers to type II error probability. It’s the probability of failing to reject the null hypothesis when it is false.
The formula for one-tailed test for the type II error probability is given by:
\(\beta=\phi\left(z_\alpha-\delta\frac{\sqrt{n}}{\sigma}\right)\)
1. Manual Computation
We know that n = 10, \(\sigma=1.25\), α = 0.05 and \(z_\alpha=1.64\) . If µ = 42 hours, \(\mu_0\ =\ 40\) hours, the difference between them is represented by\(\ \ \delta=\mu-\mu_{0.\ }\). Hence, \(\delta\) is equal to 2.
\(\beta=\phi\left(1.64-2\frac{\sqrt{10}}{1.25}\right)\)
\(\beta=\phi\left(-3.42\right)\)
\(\beta=0.0003\)
2. R Computation
Computing the standard deviation of the mean:
n = 10 # sample size
sigma = 1.25 # population standard deviation
sem = sigma/sqrt(n); sem # standard error
## [1] 0.3952847
Computing the upper bound of sample means for which the null hypothesis μ = 40 would not be rejected.
alpha = .05 # significance level
mu0 = 40 # hypothetical upper bound
q = qnorm(alpha, mean=mu0, sd=sem, lower.tail=FALSE); q
## [1] 40.65019
This means that as long as the sample mean is less than 40 in a hypothesis test, the null hypothesis will not be rejected. Since we assume that the actual population mean is 42 hours, we can compute the probability of the sample mean below 40, and thus found the probability of type II error.
mu = 42 # assumed actual mean
pnorm(q, mean=mu, sd=sem)
## [1] 0.0003191553
The type II probability error is \(\beta\) = 0.0003.
PRACTICAL INTERPRETATION
Thus, there is a probability of 0.0003 that this difference from 40 hours will not be detected. This implies that the probability that the test will fail to reject the null hypothesis when the true battery life is 42 hours, is 0.03%.
Consequently when the type II error probability is 0.0003, this means that a sample size of n=10 resulted to a great and reasonable power. The power is equal to the difference of 1 and the Beta error. Hence, the power is 0.9997. This value implies that the probability of rejecting the null hypothesis when the alternative hypothesis is true is 99.97%.
ANSWER TO D
We know that n = 10, \(\sigma=1.25\), α = 0.05 and \(z_\alpha=1.64\).
Now, µ = 44 hours and \(\mu_0\ =\ 40\) hours, the difference between them is represented by\(\ \ \delta=\mu-\mu_{0.\ }\). So, \(\delta\) is equal to 4.
The significance level is still α = 0.05 and the maximum allowed Beta error is now \(\beta=0.10\). The critical value for the alpha error is \(z_\alpha=1.64\) and the critical value for the beta error is \(z_\beta=1.28\).
1. Manual Computation
We can find the n, or the sample size required to ensure that β does not exceed 0.10 if the true mean is 44 hours through the equation:
\(n=\frac{{(z_\alpha+z_\beta)}^2\sigma^2}{\delta^2}\)
\(n=\frac{{(1.64+1.28)}^2{1.25}^2}{4^2}\)
\(n=0.833\)
\(n\approx1\)
2. R Computation
sd <- 1.25 #standard deviation
zα <- qnorm(p=0.05, lower.tail=FALSE)
zb <- qnorm(p=0.10, lower.tail=FALSE)
u <- 44 #true population mean
w <-40 #assumed population mean
s <- u-w
n<-(sd*(zα+zb)/(s))^2
n #sample size
## [1] 0.8363132
round (n,0)
## [1] 1
Having n = 1:
\(\phi\left(-z_\alpha-\delta\frac{\sqrt{n}}{\sigma}\right)=\phi\left(-1.64-4\frac{\sqrt1}{1.25}\right)=\phi\left(-4.84\right)=0\) This shows that a sample size of n=1 is a good estimation since 0 is relatively smaller than the Beta error which is 0.10.
ANSWER TO E
Our confidence level in part A is computed by \(100(1-\alpha)\)%. The significance level is α = 0.05. Thus, the confidence level is \(100(1-0.05)\)%, which is equal to 95%. The appropriate test statistic for our given data is the upper-tailed z test. With this, the appropriate confidence bound is given by the equation.
\(CB\ =\ \bar{x}+\ z_\alpha(\sigma/\sqrt{n})\)
Note that \(\mu_0\ =\ 40\), \(\bar{x}\ =\ 40.5\) hours, \(z_\alpha=1.64\), \(\sigma=1.25\), and n = 10.
CONFIDENCE BOUND FOR THE μ, THE MEAN BATTERY LIFE. :
1. Manual Computation
\(CB\ =\ \bar{x}+\ z_\alpha(\sigma/\sqrt{n})\)
\(CB\ =\ 40.5+\ 1.64(1.25/\sqrt{10})\)
\(CB=40.5+1.64\left(1.25/\sqrt{10}\right)\)
\(CB\ =\ 41.148\)
2. R Computation
#confidence-bound
sd <- 1.25 #standard deviation
sd
## [1] 1.25
za <- qnorm(p=0.05, lower.tail=FALSE)
c<- round (za,2)
x <- 40.5 #sample mean
n <- 10 #sample size
ME <- c * (sd / sqrt(n)) #margin of error
CB <- x + ME
CB
## [1] 41.14827
This means that the 95% One-Sided Confidence Interval:\(\ \mu\ \le\ 41.148\). Since the value \(\mu_0\ =\ 40\) is included in this interval, we failed to reject the null hypothesis: \(H_0\): μ = 40 hours.
REFERENCES