1 Questions and Answers

1.1 Question 1

Answer: Within the IQR, the histogram isn’t symmetric. Most orders cluster toward the lower end of the time range, with fewer trailing off toward the higher end, so the data is right-skewed. This means the typical patient is seen relatively fast, but a smaller group of patients have noticeably longer waits, and those slower cases pull the distribution out to the right rather than the data spreading evenly on both sides of a center point.

1.2 Question 2

## Median for Technician 62:  80
## Median for Technician 65:  27

Answer: Technician 65 has a much lower median completion time (around 27 minutes) than Technician 62 (around 80 minutes), which suggests Technician 65 completes orders faster than Technician 62.

1.3 Question 3

Answer: The boxplot shows that patients receiving Routine orders tend to be older than those receiving STAT orders, since the Routine box sits higher overall, and the STAT group’s age range extends further into younger patients.

1.4 Question 4

## Mean time for 3W:  1463.051
## Standard deviation for 3W:  3894.639
## Mean time for 4W:  1675.451
## Standard deviation for 4W:  4387.644

Answer: Floor 4W has a higher mean completion time (about 1,675 minutes) and a higher standard deviation (about 4,388) than floor 3W (mean about 1,463, standard deviation about 3,895). But on both floors, the standard deviation is even bigger than the mean, meaning completion times swing wildly within each floor.

2 Complete R Code

# Read in the data
dat <- read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/refs/heads/main/RadDat_IMSE.csv")
# Remove rows where the completion time is negative
dat <- dat[dat$Ordered.to.Complete...Mins >= 0, ]
rmarkdown::paged_table(dat)

# Keep only patients age 65 or older (Medicare eligible)
medicare <- dat[dat$PatientAge >= 65, ]
# Find the first and third quartile of their completion times
q1 <- quantile(medicare$Ordered.to.Complete...Mins, 0.25)
q3 <- quantile(medicare$Ordered.to.Complete...Mins, 0.75)
# Keep only the observations that fall within the IQR
medicare_iqr <- medicare[medicare$Ordered.to.Complete...Mins >= q1 & medicare$Ordered.to.Complete...Mins <= q3, ]
# Histogram of completion time
hist(medicare_iqr$Ordered.to.Complete...Mins, main = "X-Ray Completion Time for Medicare Patients (IQR Only)", xlab = "Time to Complete Order (Minutes)", ylab = "Frequency")

# Median completion time for each technician
#The function "cat" was used because "print" gave errors for this. After a search on stack overflow, I found "cat".
cat("Median for Technician 62: ",median(dat$Ordered.to.Complete...Mins[dat$Radiology.Technician == 62]))
cat("Median for Technician 65: ",median(dat$Ordered.to.Complete...Mins[dat$Radiology.Technician == 65]))

#Boxplot of patient age by priority
boxplot(dat$PatientAge[dat$Priority == "STAT"], dat$PatientAge[dat$Priority == "Routine"], names = c("STAT", "Routine"), main = "Patient Age by Order Priority", xlab = "Priority", ylab = "Patient Age (Years)")

# Mean and standard deviation of completion time for each floor
cat("Mean time for 3W: ",mean(dat$Ordered.to.Complete...Mins[dat$Loc.At.Exam.Complete == "3W"]))
cat("Standard deviation for 3W: ",sd(dat$Ordered.to.Complete...Mins[dat$Loc.At.Exam.Complete == "3W"]))
cat("Mean time for 4W: ",mean(dat$Ordered.to.Complete...Mins[dat$Loc.At.Exam.Complete == "4W"]))
cat("Standard deviation for 4W: ",sd(dat$Ordered.to.Complete...Mins[dat$Loc.At.Exam.Complete == "4W"]))