# Comparing variability of measures across time

I am working with some data where I have measurements for two outputs (Output A and Output B) for 5 participants in an experiment. Each of the 5 participants have both their Output A and Output B quantity measured over 5 timepoints. Here is an example of what the data could look like with accompanying R code:

set.seed(4)

library(ggplot2)

ids = factor(rep(rep(1:5,each=5),2))
prot = rep(c("Output A","Output B"),each=25)
day = rep(seq(1,10,2),times=10)
value = c(rnorm(25,30,2),rnorm(25,40,6))

X = data.frame(ids,prot,day,value)

ggplot(data=X,aes(day,value,group=ids,color=ids)) +
geom_line() +
geom_point() +
facet_wrap(~prot)


Now what I am interested in is determining quantitatively if the measurements for Output A has higher within subject variability than the measurements for Output B. Why this is important is because we would like, going forward, only measure that output that is more "stable" across time for an individual and so we would like to decide which output is more stable across time within subjects. And of course we would like to do this quantitatively rather than qualitatively if possible.

Now, the one big caveat to all of this is that Output A and Output B are not measured in the same units. For sake of argument lets say Output A is measured in liters and Output B is measured in grams. I think this probably greatly complicates the problem.

I was thinking that the approach might be to calculate something like the coefficient of variation since the value is unit less and essentially captures the variability of data relative to the mean, however, does something like this work when trying to only categorize within subject variation (so not total variation or between subject variation).

Any suggestions forward are greatly appreciated!

• Do you suppose that the underlying process is the same for A and B and they have same type and size of serial correlation? Jan 29, 2018 at 12:46

$\frac{\sum_\text{p} \sum_{i=1}^{N-1} (x_{p, i}-x_{p, i+1})}{\text{STDEV}(X)}$
where $x_{p, i}$ is the measurement for participant $p$ on day $i$.