Description
The data in this document consists of body temperature measurements and heart rate measurements for 65 men and 65 women. Save the data to excel and read the data into R. Use this data to address the following questions.
(1) We are interested in whether the proportion of men and women with body temperatures greater than or equal to 98.6 degrees Fahrenheit are equal. Therefore, we need to dichotomize the body temperature variable. Create a new variable, called “temp_level” in which temp_level = 1 if body temperature >= 98.6 and temp_level=0 if body temperature < 98.6. (1 point)
(2) Summarize the data relating to body temperature level by sex. (2 points)
(3) Calculate the risk difference. Formally test (at the α=.05 level) whether the proportion of people with higher body temperatures (greater than or equal to 98.6) is the same across men and women, based on this effect measure. Do females have higher body temperatures than males? (4.5 points)
(4) Perform a logistic regression with sex as the only explanatory variable. Formally test (at the α=.05 level) if the odds of having a temperature greater than or equal to 98.6 is the same between males and females. Include the odds ratio for sex and the associated 95% confidence interval based on the model in your summary and interpret this value. What is the c-statistic for this model? (5.5 points)
(5) Perform a multiple logistic regression predicting body temperature level from sex and heart rate. Summarize briefly the output from this model. Give the odds ratio for sex and heart rate (for a 10 beat increase). What is the c-statistic of this model? (5 points)
(6) Which model fit the data better? Support your response with evidence from your output. Present the ROC curve for the model you choose. (2 points)
Data (1=males, 2 =females)
temp | sex | Heart rate |
96.3 | 1 | 70 |
96.7 | 1 | 71 |
96.9 | 1 | 74 |
97 | 1 | 80 |
97.1 | 1 | 73 |
97.1 | 1 | 75 |
97.1 | 1 | 82 |
97.2 | 1 | 64 |
97.3 | 1 | 69 |
97.4 | 1 | 70 |
97.4 | 1 | 68 |
97.4 | 1 | 72 |
97.4 | 1 | 78 |
97.5 | 1 | 70 |
97.5 | 1 | 75 |
97.6 | 1 | 74 |
97.6 | 1 | 69 |
97.6 | 1 | 73 |
97.7 | 1 | 77 |
97.8 | 1 | 58 |
97.8 | 1 | 73 |
97.8 | 1 | 65 |
97.8 | 1 | 74 |
97.9 | 1 | 76 |
97.9 | 1 | 72 |
98 | 1 | 78 |
98 | 1 | 71 |
98 | 1 | 74 |
98 | 1 | 67 |
98 | 1 | 64 |
98 | 1 | 78 |
98.1 | 1 | 73 |
98.1 | 1 | 67 |
98.2 | 1 | 66 |
98.2 | 1 | 64 |
98.2 | 1 | 71 |
98.2 | 1 | 72 |
98.3 | 1 | 86 |
98.3 | 1 | 72 |
98.4 | 1 | 68 |
98.4 | 1 | 70 |
98.4 | 1 | 82 |
98.4 | 1 | 84 |
98.5 | 1 | 68 |
98.5 | 1 | 71 |
98.6 | 2 | 77 |
98.6 | 1 | 78 |
98.6 | 1 | 83 |
98.6 | 2 | 66 |
98.6 | 1 | 70 |
98.6 | 1 | 82 |
98.7 | 2 | 73 |
98.7 | 1 | 78 |
98.8 | 1 | 78 |
98.8 | 1 | 81 |
98.8 | 2 | 78 |
98.9 | 1 | 80 |
99 | 2 | 75 |
99 | 2 | 79 |
99 | 1 | 81 |
99.1 | 1 | 71 |
99.2 | 1 | 83 |
99.3 | 1 | 63 |
99.4 | 1 | 70 |
99.5 | 1 | 75 |
96.4 | 2 | 69 |
96.7 | 2 | 62 |
96.8 | 1 | 75 |
97.2 | 1 | 66 |
97.2 | 2 | 68 |
97.4 | 2 | 57 |
97.6 | 1 | 61 |
97.7 | 2 | 84 |
97.7 | 1 | 61 |
97.8 | 2 | 77 |
97.8 | 2 | 62 |
97.8 | 2 | 71 |
97.9 | 1 | 68 |
97.9 | 2 | 69 |
97.9 | 2 | 79 |
98 | 2 | 76 |
98 | 1 | 87 |
98 | 2 | 78 |
98 | 2 | 73 |
98 | 2 | 89 |
98.1 | 2 | 81 |
98.2 | 2 | 73 |
98.2 | 2 | 64 |
98.2 | 2 | 65 |
98.2 | 2 | 73 |
98.2 | 2 | 69 |
98.2 | 2 | 57 |
98.3 | 2 | 79 |
98.3 | 2 | 78 |
98.3 | 2 | 80 |
98.4 | 2 | 79 |
98.4 | 2 | 81 |
98.4 | 2 | 73 |
98.4 | 2 | 74 |
98.4 | 2 | 84 |
98.5 | 2 | 83 |
98.6 | 2 | 82 |
98.6 | 2 | 85 |
98.6 | 2 | 86 |
98.6 | 2 | 77 |
98.7 | 2 | 72 |
98.7 | 2 | 79 |
98.7 | 2 | 59 |
98.7 | 2 | 64 |
98.7 | 2 | 65 |
98.7 | 2 | 82 |
98.8 | 2 | 64 |
98.8 | 2 | 70 |
98.8 | 2 | 83 |
98.8 | 2 | 89 |
98.8 | 2 | 69 |
98.8 | 2 | 73 |
98.8 | 2 | 84 |
98.9 | 2 | 76 |
99 | 2 | 79 |
99 | 2 | 81 |
99.1 | 2 | 80 |
99.1 | 2 | 74 |
99.2 | 2 | 77 |
99.2 | 2 | 66 |
99.3 | 2 | 68 |
99.4 | 2 | 77 |
99.9 | 2 | 79 |
100 | 2 | 78 |
100.8 | 2 | 77 |