Experimental setup
We have N
individuals that underwent treatment A
and N
individuals that underwent treatment B
. In each individual, we measure after treatment two variables X
and Y
. X
and Y
are both unitless.
There is no meaningful before treatment measurement and the data from the two treatment groups cannot be paired in any logical way.
Question
The treatment has an effect on both X
and Y
. I would like to compare these effects. I would like to test the null hypothesis that the treatment affect both variables X
and Y
by the same multiplying factor.
How should I go about performing such test?
Example
Consider this made-up data set
set.seed(12)
N = 1e3
d = data.frame(
Treatment = rep(LETTERS[1:2], each=2*N),
variable = rep(rep(LETTERS[24:25], each=N),2),
value = c
(
runif(N,0,100), # Treatment A, variable X
runif(N,50,120), # Treatment A, variable Y
runif(N,0,100) * 1.2, # Treatment B, variable X
runif(N,50,120) * 1.5 # Treatment B, variable Y
)
)
require(ggplot2)
ggplot(d, aes(x=variable, y=value, color=Treatment, group=Treatment)) + stat_summary(fun.y=mean, geom="point") + stat_summary(
fun.y=mean,
fun.ymin = function(x) mean(x) - sd(x) / sqrt(length(x)),
fun.ymax = function(x) mean(x) + sd(x) / sqrt(length(x)),
geom="errorbar", width=0.3) + theme_classic()
This data set was created so that the treatment affected the variable X
by a multiplying factor of 1.2 and affected the variable Y
by a multiplying factor of 1.5. The null should therefore be rejected as 1.2 ≠ 1.5.
My thoughts
I thought I could run some linear model of the kind
Value ~ Treatment + variable + Treatment:variable
with a type I sum of squares and investigate the significance of the interaction term. I might have to transform the data beforehand to ensure both variables have the same mean and variance but I am not sure. This regression does not quite seem to be what I am after though and conceptually, it hurts my soul to organize my data under such format for a test (although it is the format I chose for my made-up data)!
PC1 ~ Treatment
? I don't fully understand how that would help but I probably misunderstand your suggestion. Thanks! $\endgroup$