library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
data1 <- read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/refs/heads/main/RadDat_IMSE.csv")
Question 1
data1 <- data1[ , c("PatientAge","Radiology.Technician", "Priority","Loc.At.Exam.Complete","Ordered.to.Complete...Mins")]
## Filtering Colums and Rows
data1 <- data1[data1$'Ordered.to.Complete...Mins' >= 0, ]
Wise_Men <- data1[data1$PatientAge >= 65, ]
quantile(quantile(Wise_Men$Ordered.to.Complete...Mins,0.25),0.25)
## 25%
## 21
quantile(Wise_Men$Ordered.to.Complete...Mins,0.75)
## 75%
## 90
Xray_time<-Wise_Men[Wise_Men$Ordered.to.Complete...Mins>21 & Wise_Men$Ordered.to.Complete...Mins <90,5]
hist(Xray_time,breaks = 25,col = "blue",main = "Time to Complete X-Ray Orders for Medicare Patients (IQR Range)",xlab = "Time to Complete (minutes)",ylab = "Frequency")
QUESTION 2: RADIOLOGY TECHNICIAN COMPARISON
median(data1[data1$Radiology.Technician == 62,5])
## [1] 80
median(data1[data1$Radiology.Technician == 65,5])
## [1] 27
#The median for 62 is higher than it is for 65.
Question 3
summary(data1$Priority)
## Length Class Mode
## 43548 character character
STAT<- data1 %>% filter(Priority=="STAT")
Routine<- data1 %>% filter(Priority=="Routine")
boxplot(data1$PatientAge[data1$Priority == "Routine"],
data1$PatientAge[data1$Priority == "STAT"],
names = c("Routine", "STAT"),
main = "Patient Age by X-Ray Order Priority",
xlab = "Order Priority",
ylab = "Age (Years)",
col = c("yellow", "violet"))
Question 4
floor_data_3 <- data1 %>% filter(Loc.At.Exam.Complete == "3W")
floor_data_4 <- data1 %>% filter(Loc.At.Exam.Complete == "4W")
mean(floor_data_3$Ordered.to.Complete...Mins)
## [1] 1463.051
mean(floor_data_4$Ordered.to.Complete...Mins)
## [1] 1675.451
#It usually takes longer to get an x-ray done on floor 4W than it does on 3W.