Question 1:

dat <- read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/refs/heads/main/RadDat_IMSE.csv") 
data <- dat[dat$Ordered.to.Complete...Mins >= 0,]
head(data)
age<-data[data$PatientAge>=65,] 
age 
mdtime<-age$Ordered.to.Complete...Mins
mdtime
IQRmd<-quantile(mdtime,probs = c(0.25, 0.75))
IQRmd
hiqr<-age[age$Ordered.to.Complete...Mins>=IQRmd[1] & age$Ordered.to.Complete...Mins<=IQRmd[2],]
hist(hiqr$Ordered.to.Complete...Mins,main='Patients over 65 Time to Fulfill X-Ray Orders',xlab='age',ylab='time in minutes',col='lightpink',border='purple')

Analysis

Based on the plot, the time needed to fulfill X-Ray orders decreases as the patient’s age increases which is shown in the downwards slope of the graph.Thus, demonstrating an inverse relationship between the two.

Question 2:

med62 <- median(data$Ordered.to.Complete...Mins[data$Radiology.Technician == 62]) 
med65 <- median(data$Ordered.to.Complete...Mins[data$Radiology.Technician == 65]) 
cat('Median time of Technician 62:',med62) 
## Median time of Technician 62: 80
cat('Median time of Technician 65:',med65)
## Median time of Technician 65: 27

Analysis

Technician 65 has a significantly lower median compared to Technician 62 in their times to complete x-ray orders. This implies Technician 65 takes less time to fulfill X-Ray orders.

Question 3:

bp_data <- split(data$PatientAge, data$Priority) 
boxplot(bp_data,main='Patient Age and Priority Status',xlab='age',lab='priority',names=c('STAT','Routine'),col=c('lightblue','lightpink')) 

Analysis

Based on the box plots, Routine Priority is given to patients ages 30-70, while STAT is typically given to patients that are 50-70 years old. Therefore, Routine Priority is given to a wider range of patients.

Question 4:

floor3w<-data[data$Loc.At.Exam.Complete=="3W",]
floor4w<-data[data$Loc.At.Exam.Complete=="4W",]

mean3w<-mean(floor3w$Ordered.to.Complete...Mins)
sd3w<-sd(floor3w$Ordered.to.Complete...Mins)

mean4w<-mean(floor4w$Ordered.to.Complete...Mins)
sd4w<-sd(floor4w$Ordered.to.Complete...Mins) 
cat('Floor 3W mean:',mean3w,'Floor 3W standard deviation:',sd3w) 
## Floor 3W mean: 1463.051 Floor 3W standard deviation: 3894.639

{cat('Floor 4W mean:',mean4w,'Floor 4W standard deviation:',sd4w)}

Analysis

Floor 3 tends to fulfill X-Ray orders far quicker than Floor 4.