Question
The data in the table below give the duration in days of hospital stays of patients admitted to the hospital with C. Difficile . Use
The data in the table below give the duration in days of hospital stays of patients admitted to the hospital with C. Difficile. Use the data on the following page to:
(1) Save the data to excel and read into R for analysis. You will need to reshape the data into a single vector. Each number corresponds to the duration of stay for one patient in the hospital. (2 points)
(2) Make a histogram of the duration of days of hospital stays. Ensure the histogram is labelled appropriately. Use a width of 1 day. Describe the shape, center, and spread of the data. Recreate the histogram using a width of 5 days, how does the interpretation of the histogram change? Are there any outliers? If so, how would you deal with these outliers? (7 points)
(3) Find the mean, median, standard deviation, first and third quartiles, minimum and maximum of the durations of hospital stay in the sample. Summarize these values in an easy-to-read table. In other words, do *not* simply copy and paste R output. Given the shape of the distribution, state the appropriate numerical summary of the center and spread of the distribution.
7 | 3 | 5 | 3 | 1 | 5 | 10 | 3 | 4 | 4 |
7 | 5 | 8 | 3 | 4 | 1 | 15 | 4 | 5 | 8 |
5 | 3 | 2 | 3 | 5 | 9 | 4 | 5 | 6 | 9 |
5 | 3 | 6 | 3 | 2 | 6 | 4 | 5 | 5 | 4 |
5 | 8 | 4 | 6 | 13 | 4 | 6 | 3 | 2 | 3 |
2 | 4 | 6 | 6 | 6 | 8 | 6 | 3 | 4 | 4 |
5 | 10 | 4 | 6 | 3 | 9 | 3 | 9 | 4 | 7 |
10 | 14 | 4 | 6 | 5 | 10 | 4 | 4 | 9 | 4 |
4 | 3 | 6 | 8 | 5 | 7 | 6 | 1 | 3 | 12 |
11 | 5 | 2 | 1 | 4 | 4 | 5 | 6 | 4 | 2 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started