In: Statistics and Probability
Temperature |
98.74 |
98.54 |
97.87 |
98.12 |
99.64 |
97.84 |
98.92 |
98.33 |
98.83 |
97.89 |
97.42 |
99.27 |
97.88 |
97.87 |
98.33 |
98.09 |
96.8 |
97.9 |
97.3 |
97.48 |
Normal body temperature? A random sample of 20 healthy adults was collected and their body temperatures were measured in degrees Fahrenheit. The data can be found in an excel file Body with variable name Temperature. Do these data give evidence that the true mean body temperature for healthy adults is not equal to the traditional 98.6 degrees Fahrenheit? Test an appropriate hypothesis at 5% level of significance. (50 points total)
Source: Moore, D., Notz, W. and Fligner, M. (2015). The Basic Practice of Statistics (7th edition). New York, NY: W. H. Freeman and Company.
Label the parameter: (4 points)
State null and alternative hypotheses: (6 points)
H0:
Ha:
Propose an appropriate hypothesis test. Explain! (4 points)
Verify the required conditions for the proposed hypothesis test: (8 points)
Randomization assumption:
Normality assumption:
Note: For your future reference, save your R codes and normal QQ plot on your machine:
Using R, report test statistic, df, and p-value. (9 points)
Test statistic =
df =
p-value =
Note: For your future reference, save your R codes and outputs on your machine:
Interpret test statistic: (4 points)
Interpret the P-value in context: (6 points)
Make a decision of hypothesis test: (4 points)
Make a conclusion of hypothesis test in context: (5 points)
Solution:
Here we have a sample of size (n) 20 and we are interested in testing the hypothesis that the true mean is not equal to the traditional mean i.e., 98.6-degree Fahrenheit. Then we have to use one sample t test. The process is as follow:
Let, sample mean (x), population mean (μ), sample standard deviation (σ) and number of observations (n). Using these notation, we would construct the hypotheses and perform the hypothesis test as:
T-Test Assumptions
Hypothesis:
Null Hypothesis (H0): μ= 98.6-degree Fahrenheit
Alternate Hypothesis (Ha): μ≠ 98.6-degree Fahrenheit
Test statistic: t=x-μσ/n, which follows a t distribution.
Normality test:
Shapiro-Wilk’s normality test is used here. The hypotheses are as follow;
Null Hypothesis (H0): the data follows a normal distribution
Alternate Hypothesis (Ha): the data do not follow a normal distribution
Decision rule: Reject null hypothesis if p value is less than 0.05, otherwise not. Here we have found that the p-value is more than 0.05 i.e., 0.9747 thus, the data set follow a normal distribution. So, we can perform the t test. The Normal Q-Q plot also given below:
R-code and output:
> # Import the Data > temperature <- read.csv("btemp.csv",header = T) > attach(temperature) > > # Normality test > shapiro.test(temperature$temperature) Shapiro-Wilk normality test data: temperature$temperature W = 0.97476, p-value = 0.8504 > > # QQ NORMAL PLOT > qqnorm(temperature$temperature) > qqline(temperature$temperature,col="red",lwd=2) > > # One sample t-test (Two Tailed = not equal type) > t.test(temperature, alternative = c("two.sided"),mu = 98.6,conf.level = 0.95) One Sample t-test data: temperature t = -2.8914, df = 19, p-value = 0.009353 alternative hypothesis: true mean is not equal to 98.6 95 percent confidence interval: 97.82943 98.47657 sample estimates: mean of x 98.153 |
Test statistic = t = -2.8914 df = 19 p-value = 0.0093 |
Interpretation and conclusion:
1. The test statistic can be obtained by using the formula given in equation (1), here it is -2.8914.
2. The p-value gives the reason to take the decision about the hypothesis which is being tested. If the p-value is less than or equal to the α proposed in the question, which is level of significance, then we would reject the null hypothesis otherwise not.
3. Here we would reject the null hypothesis based on the above result.
4. Thus, we may conclude that the average body temperature of healthy adults is not equal to the traditional 98.6-degree Fahrenheit. Here it may fall between the range of 97.82943 to 98.47657, it is evident from the confidence interval for the given α=0.05.