Module # 4 Programming structure assignment
The following data was collected by the local hospital. This data set contains 5 variables based on the observation of 10 patients. In addition to the measurements of the patients checking in to the hospital that night, this data provides the patients' histories regarding the frequency of their visits to the hospital in the last 12 months.
This data displays the measurement of blood pressure, first assessment by a general doctor (bad=1, good =0) titled "first," the second assessment by an external doctor (called "second"), and the last row provides the head of the emergency unit's decision regarding immediate care for the patient based on the values 0 or 1 (low = 0, high =1).
The names of your variables are as follows: "Freq","bloodp","first”, " second”, ”finaldecision”
The rows
1. "0.6","103","bad","low","low”
2. "0.3","87","bad","low","high”
3. "0.4","32","bad","high","low”
4. "0.4","42","bad","high","high"
5. "0.2","59","good","low","low”
6. "0.6","109","good","low","high”
7. "0.3","78","good","high","low”
8. "0.4","205","good","high","high”
9. "0.9","135",”NA","high","high"
10. "0.2","176",”bad","high","high”
A. Your first assignment: Create a side-by-side boxplot (>boxplot(x, ...)) and and histogram (>hist(x,...)
In the following examples, I used different data containers for the boxplot and histogram visual display.
1. Boxplot
I use the following data container (3,2,5,6,4,8,1,2,3,2,4)
A <- c(3, 2, 5, 6, 4, 8, 1, 2, 3, 2, 4)boxplot(A)
2. Histogram I used following data container (2,4,5,7,12,14,16)B <- c(2, 4, 5, 7, 12, 14, 16)
hist(B)
B. Discuss the outcome of your results regarding patients BPs & MD’s Ratings.
The boxplot and histogram of blood pressure show that most patients fall within a moderate range, but there are two very high values (176 and 205), which appear as potential outliers. This indicates that while most patients have relatively normal or moderately elevated blood pressure, a small number present extreme risk levels. Comparing these values with doctors’ assessments shows that higher blood pressure readings tend to align with “high” second assessments and “high” final decisions. For example, patients with blood pressures above 130 generally receive high-risk classifications. This suggests that blood pressure is a strong contributing factor in determining emergency priority.
C. Post your result in your blog and code on GitHub.
Comments
Post a Comment