Statistical test to compare precision of two devices I am comparing two temperature control devices both designed to maintain body temperature at exactly 37 degrees in anaesthetised patients. The devices were fitted to 500 patients forming two groups. Group A (400 patients) - Device 1, Group B (100 patients)- Device 2. Each patient had their temperature measured once every hour for 36 hours, giving me 18000 data points across two groups. I need to determine which device controls the patients' body temperature more precisely over the 36 hour period. 
I have constructed line graphs joining the median values at each time point with quartile bars and visually there seems to be a difference.
How should I be analysing my data to prove a statistical difference?
 A: The first thing you will need to think about is what it means (quantitatively) to have "good precision" in such a device.  I would suggest that, in a medical context, the goal is to avoid temperature deviations that go into a dangerous range for the patient, so "good precision" is probably going to translate into avoiding dangerously low or high temperatures.  This means you are going to be looking for a metric that heavily penalises large deviations from your optimal temperature of 37$^\text{o}$C.  In view of this, measurement based on fluctuations in median temperatures is going to be a bad measure of precision, whereas measures that highlight large deviations will be better.
When you are formulating this kind of metric, you are implicitly adopting a "penalty function" that penalises temperatures that deviate from your desired temperature.  One option would be to measure "precision" by lower variance around the desired temperature (treating this as the fixed mean for the variance calculation).   The variance penalises by squared error, so that gives reasonable penalisation for high deviations.  Another option would be to penalise more heavily (e.g., cubed-error).  Another option would be to simply measure the amount of time each device has the patient outside the temperature range that is medically safe.  In any case, whatever you choose should reflect the perceived dangers of deviation from the desired temperature.
Once you have determined what constitutes a metric of "good precision", you are going to be formulating some kind of "heteroscedasticity test", formulated in the wider sense of allowing whatever measure of precision you are using.  I'm not sure I agree with whuber's comment of adjusting for autocorrelation.  It really depends on your formulation of loss - after all, staying in a high temperature range for an extended period of time could be exactly the thing that is the most dangerous, so if you adjust back to account for auto-correlation, you might end up failing to penalise highly dangerous outcomes sufficiently.
A: This is a test of homoscedasticity. And because this is a time-series, the appropriate choice is the Breusch–Pagan test, not the F-test. This test only answers ONLY the question of equality of precision between the two devices. Level of precision is another way of thinking of variance.
[Edit: Changed the test to the correct one, considering the time-dependence]
A: If you are interested in how well devices maintain a 37C temperature, you can either:


*

*Use all available data from each person as is or

*Estimate the mean deviation per person from 37C using each person's 36 trials.


The data naturally lends itself to repeated measures treatment. By treating within-person trials as clusters, you will reduce the likelihood of a falsely estimated confidence interval around the effect of device. In addition, you can test the effect of time among both devices or as an interaction with device to ascertain whether maintenance of temperature over time was good. Finding a way to visualize all this is of key importance and may suggest one approach over another. Something along the lines of:
library(dplyr)
library(lme4)

set.seed(42)
id <- rep(1:500, each=36)
time <- rep(1:36,500)
temp <- c(rnorm(36*400, 38,0.5), rnorm(36*100,37.25,0.5))
temp <- temp + 1/time

prox_37 <- temp - 37
group <- c(rep("A",36*400), rep("B",36*100))
graph_t <- ifelse(group=="A", time-0.25, time+0.25)
df <- data.frame(id,time,temp,prox_37,group, graph_t)

id_means <- group_by(df, id) %>% summarize(mean_37 = mean(prox_37))
id_means$group <- c(rep("A",400), rep("B",100))

boxplot(id_means$mean_37 ~ id_means$group)

plot(graph_t, prox_37, col=as.factor(group))
loess_fit <- loess(prox_37 ~ time, data = df)
lines(c(1:36), predict(loess_fit, newdata= c(1:36)) , col = "blue")

summary(t.test(mean_37 ~group, data=id_means))

model1 <- glm(prox_37 ~ as.factor(group), family = "gaussian", data=df)
model2 <- lmer(prox_37 ~ as.factor(group) + (1 | id), data=df)
model3 <- lmer(prox_37 ~ as.factor(group) + time + (1 | id), data=df)
model4 <- lmer(prox_37 ~ as.factor(group) + time + time*as.factor(group) + (1 | id), data=df)

AIC(model1)
summary(model2)
summary(model3)
summary(model4)


