Please help, using R.
(a) Use R to provide five-number summaries, means, and standard deviations for the heights and weights of males and females separately (so you will generate four sets of data).
b) Use R to provide, for each age bracket (defined according to decade, so one bracket consists of people in their twenties, another of people in their thirties, and so forth), a stacked bar chart in which each stacked bar illustrates the number of drinkers (social and problem) as well as the number of smokers (light and heavy).
Return to Problem (a). Namely, determine the outliers in each of the four data sets.
The pulse pressure is the systolic reading minus the diastolic reading. A value under 40 or above 60 is considered bad. Use R to find the pulse pressure for each patient (provide your code), and list the patients whose scores are "bad." How much overlap is there between this list and your list of outliers above?
You decide to define a new variable called WillReturn as follows, using the floor function:
The value of BPP is 0 or 1 depending on whether, according to part (b), someone does or does not have a bad pulse pressure reading, respectively. A value of 4 or more for WillReturn means the patient is more likely than not to return to the ER within the next 12 months. Based on that criterion, use R to learn how many of the patients can you expect to return (provide your code).
VisitType, Age, Gender, Height, Weight, BPSyst, BPDias, NumMed, Drinks, Smokes, WaitTimeWR, WaitTimeMD, NumLab, DiscAdmit
P1, 0, 18, 0, 63.2, 142.7, 131, 86, 1, 0, 2, 16.7, 21.3, 2, 0
P2, 1, 23, 1, 68.9, 175.3, 126, 88, 2, 1, 0, 21.3, 18.6, 1, 0
P3, 1, 54, 0, 64.6, 197.4, 159, 98, 4, 1, 0, 24.8, 26.7, 3, 1
P4, 1, 65, 0, 61.8, 129.5, 130, 85, 4, 0, 0, 23.6, 20.7, 2, 0
P5, 2, 43, 1, 71.8, 232.1, 153, 101, 3, 1, 2, 26.9, 28.3, 3, 1
P6, 1, 41, 0, 66.3, 191.4, 138, 87, 4, 2, 0, 20.8, 31.3, 3, 0
P7, 0, 57, 1, 70.2, 203.7, 139, 89, 1, 0, 0, 19.6, 24.3, 2, 1
P8, 0, 33, 1, 72.6, 256.9, 133, 91, 0, 0, 1, 16.9, 22.7, 3, 0
P9, 1, 29, 1, 67.3, 176.4, 128, 81, 0, 1, 1, 27.8, 38.4, 1, 0
P10, 2, 67, 0, 59.5, 152.7, 155, 94, 5, 2, 1, 25.9, 41.8, 3, 1
P11, 0, 40, 1, 73.9, 164.8, 117, 79, 2, 1, 0, 33.8, 40.6, 1, 0
P12, 1, 71, 0, 69.3, 157.2, 153, 94, 3, 1, 2, 31.6, 33.9, 2, 0
P13, 1, 56, 1, 70.8, 285.7, 161, 109, 5, 0, 1, 39.3, 34.6, 3, 1
P14, 0, 31, 1, 75.5, 239.1, 138, 97, 0, 2, 1, 27.9, 42.5, 2, 0
P15, 0, 63, 0, 65.3, 128.9, 122, 80, 1, 1, 0, 43.4, 37.6, 2, 0
P16, 1, 42, 0, 68.4, 177.8, 129, 92, 2, 2, 0, 26.6, 42.5, 3, 1
P17, 1, 35, 0, 62.1, 133.8, 137, 95, 1, 1, 2, 39.4, 44.8, 4, 1
P18, 2, 26, 0, 68.3, 121.5, 118, 75, 3, 2, 0, 47.7, 46.5, 2, 0
P19, 2, 59, 1, 64.2, 163.3, 155, 93, 3, 0, 1, 35.9, 51.5, 3, 1
P20, 1, 53, 0, 61.9, 144.6, 128, 88, 2, 1, 0, 46.5, 38.9, 1, 0
P21, 0, 50, 1, 68.8, 157.8, 146, 94, 3, 1, 2, 37.5, 41.6, 2, 0
P22, 0, 28, 0, 71.1, 180.6, 141, 92, 2, 2, 0, 45.8, 29.9, 1, 0
P23, 1, 19, 0, 65.2, 135.7, 124, 78, 2, 1, 2, 39.5, 52.7, 1, 0
P24, 1, 82, 0, 61.6, 143.8, 162, 97, 4, 1, 0, 36.1, 42.3, 4, 1
P25, 1, 46, 1, 66.4, 197.3, 149, 93, 2, 0, 2, 48.3, 61.7, 2, 0
P26, 1, 61, 0, 58.3, 115.7, 140, 83, 2, 1, 1, 29.5, 57.3, 3, 0
P27, 0, 68, 1, 71.7, 242.9, 158, 92, 3, 2, 2, 48.2, 37.6, 2, 0