Visualizing Hospital Data
LIS4370
This week’s assignment focused on visualizing patient data collected by a local hospital. The goal was to intake raw observation data (including blood pressure and doctor assessments) and create visual tools to analyze the relationship between a patient’s vital signs and the doctor’s decision-making.
The Data Setup The dataset consisted of 10 patients with variables for visit frequency, blood pressure (BP), and three different assessments. A key part of the “data auditing” process here was converting the categorical text (e.g., “bad”, “good”, “low”, “high”) into numeric indicators (1s and 0s) so R could process them mathematically.
Visual Analysis
1. Histograms I used a histogram to look at the distribution of Blood Pressure (bloodp).
Code:
hist(bloodp)Observation: The histogram reveals a very wide spread in patient conditions. We have values as low as 32 (likely shock/hypotension) and as high as 205 (hypertensive crisis). The distribution is not normal; it is scattered, reflecting the emergency nature of the input data.
2. Side-by-Side Boxplots I generated boxplots to correlate the Blood Pressure with the MD’s ratings (first and second).
Code:
boxplot(bloodp ~ First)Observation: The boxplots allow us to see how the doctor’s subjective rating (”good” vs “bad”) aligns with the objective metric (BP).
Interestingly, the “Bad” (1) assessment group includes both extremely low (32, 42) and extremely high (176) blood pressures.
This suggests the “Bad” label correctly captures extremes at both ends of the spectrum, while the “Good” (0) assessments tended to cluster more towards the middle, though there was one outlier (205) in the “Good” group which might indicate a data entry error or a misdiagnosis in the fictional dataset.
Conclusion The visualizations highlight that “Bad” health ratings correlate with extreme deviations in blood pressure (either too high or too low), whereas “Good” ratings generally align with more stable, though still elevated, pressures.
GitHub Repository: You can view the full R script here: https://github.com/ianalloway/R-programming-assignment/blob/main/assignment4.r

