Homework 2
Problem 2.1: Use the
University of Queensland Vital Signs Dataset data
to do some QC charts and vital sign monitoring for several patients
(e.g., cases 1, 3, 4).
Some cases are available here.
Filenames “UQ_VitalSignsData_Case0#.csv” (where “#” is a number indexing the case).
- Generate some (clinically relevant) plots of the data.
- Use Control Charts to identify possible critical time-points (events).
Note:
VitalData <- read.csv('https://umich.instructure.com/files/366336/download?download_frd=1',as.is=T, header=T)
VitalData$Time <- gsub("_", ".", VitalData$Time) # replace the “_” with “.” In the Time to indicate milliseconds
head(strptime(VitalData$Time, "%H:%M:%OS"))
library("reshape2"); library("ggplot2")
VitalData_long <- melt(VitalData, id.vars="Time",
# The source columns
measure.vars=c("SpO2", "CO2", "ECG", "AWF", "inO2", "Pulse", "Pleth", "NBP_.Mean.", "awRR", "MAC", "Minute_Volume", "inN2O", "imCO2"),
# Name of the destination column that will identify the original
# column that the measurement came from
variable.name="Feature",
value.name="Measurement") # convert to long format
ggplot(data=VitalData_long, aes(x=strptime(VitalData_long$Time, "%H:%M:%OS"), y=Measurement, colour=Feature)) +
geom_line()
Problem 2.2: Fit in a mixed effects model to the
lung cancer data.
Determine several covariates of clinical interest and interpret your findings in
terms of the specific measures/results.