0

I have two time series, A and B, which represent reactions of subject A and B to a certain medication measured at different point in times. I want to formally test that the reaction of patient A is statistically smaller than patient B. Since reactions are coded such that they can be both positive and negative even for the same patient, I am interesting in showing that reaction of patient A is statistically closer to zero than that of patient B.

At first, I though to take absolute values of both series and perform a Welch test, but in this way I mechanically bias the standard deviation and the mean of the series in a way that is not what I want: e.g. if A has reactions -2 and 1, and B has 1 and 1, the mean reaction of A is smaller than B (-0.5), but if I take absolute values and look at the means it seems instead that A has a bigger reaction (1.5).

Somebody knows a formal test for my hypothesis?

Richard Hardy
  • 54,375
  • 10
  • 95
  • 219
Matteo
  • 11
  • 1
  • In one paragraph you describe your situation but in the following one you seem to deny your own assumptions and objectives! If you truly want to test whether A's responses tend to be closer to zero than B's, then indeed the proper measure must be some distance to zero, of which the absolute value is a perfectly fine example. – whuber Jan 06 '22 at 14:48
  • yes I must say I am a bit confused and maybe I am overthinking the problem. But using absolute value and then mean, we get 1.5 for A and 1 for B, whereas the mean reaction is actually -0.5 for A and 1 for B. Hence, if I used abs value I would erreneously say that A has stroger reaction than B. Do you see this problem, too? My purpose does not consider how much variation is there in the series, only which one is closer to zero. And I am looking for a formal test for this. – Matteo Jan 06 '22 at 15:07
  • In that case, what you are testing is whether the *mean* response is closer to zero. The actual responses of $A$ are not closer to zero than those of $B$, but the average response is. Is that what you want? – jbowman Jan 06 '22 at 18:47
  • If you just have two time series, one for A and one for B, it seems that observations within A and within B are dependent, so standard two-sample tests based on the independence assumption will be invalid (be it using absolute values or not). – Christian Hennig Jan 06 '22 at 20:56
  • yes exactly, I need to test indeed that the _mean_ response of A is closer to zero than B @jbowman – Matteo Jan 07 '22 at 13:01
  • true that the observations within A can be serially correlated, and the same holds for B. I was planning to use a Welch test to test $H_0: mean_B<=mean_A$ and $H_1: mean_B>mean_A$ for samples (A and B) with unequal variances. If this is not a good test, do you know if there is a more appropriate way? @ChristianHennig – Matteo Jan 07 '22 at 13:06
  • @Matteo The Welch test assumes independence and will not be valid. Unfortunately anything alternative I can think of would require time series modelling, there's no standard way of doing this. Unfortunately, if you only have two time series, any observed differences between overall means could potentially be explained by dependence rather than true differences in means, unless further model assumptions are made. – Christian Hennig Jan 07 '22 at 14:00
  • I've seen this in a famous journal article. The authors have similar samples A and B like mine (although their A and B represent the reaction of the same patient over time with and without a preliminary medical practice, respectively). They say something like "we can test whether the difference in reactions is statistically significant with a simple t-test for a difference in means". Hence I thought about Welch test, because the two samples relative to the same patient with and without medical practice have unequal variances by construction. Do you think they meant something different? @Christ – Matteo Jan 07 '22 at 14:16
  • @Matteo I think I've said what I had to say. I can't obviously comment on an article I haven't seen. – Christian Hennig Jan 07 '22 at 20:58
  • One thing more anyway: If you just want to say what's closer to zero, you don't need a test. You don't need to make a significance claim. You can just compare how close they are. I'm not sure what kind of generalisation you could get out of a significance claim anyway. Obviously comparing two specific patients will not allow you to generalise anything to other patients anyway, even if a valid test could be found. – Christian Hennig Jan 07 '22 at 21:01

0 Answers0