rad <- read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/refs/heads/main/RadDat_IMSE.csv")

Question 1

# age 65+
medicare <- rad[rad$PatientAge >= 65, ]

Q1 <- quantile(medicare$Ordered.to.Complete...Mins, 0.25)
Q3 <- quantile(medicare$Ordered.to.Complete...Mins, 0.75)

medicare_iqr <- medicare[medicare$Ordered.to.Complete...Mins >= Q1 &medicare$Ordered.to.Complete...Mins <= Q3, ]

hist(medicare_iqr$Ordered.to.Complete...Mins,main = "Histogram of X-Ray",xlab = "Time (Minutes)",ylab = "Frequency")

This histogram shows how long X-rays take for older patients. It helps us see if most times are similar or take much longer.

Question 2

rt62 <- rad$Ordered.to.Complete...Mins[rad$Radiology.Technician == 62]
rt65 <- rad$Ordered.to.Complete...Mins[rad$Radiology.Technician == 65]

median(rt62)
## [1] 80
median(rt65)
## [1] 27

The median shows the typical time each technician takes. The smaller median usually works faster. Telling us who works faster.

Question 3

boxplot(PatientAge ~ Priority,data = rad,main = "STAT vs Routine",xlab = "Priority",ylab = "Patient Age")

The boxplot compares the ages of patients for STAT and Routine orders. It shows which group has older patients on average and how spread out the ages are.

Question 4

floor3W <- rad$Ordered.to.Complete...Mins[rad$Loc.At.Exam.Complete == "3W"]

mean(floor3W)
## [1] 1463.051
sd(floor3W)
## [1] 3894.639
floor4W <- rad$Ordered.to.Complete...Mins[rad$Loc.At.Exam.Complete == "4W"]

mean(floor4W)
## [1] 1675.451
sd(floor4W)
## [1] 4387.644

The mean shows the average time on each floor. The std(standard deviation) shows how spread they are. Which means that a higher mean, means slower time. Higher std means less consistency.