# Can you run another t-test on the differences after your 1st t-test results?

Let's say we are measuring the amount of anger (numerically) among males and females before and after watching a short video.

Males Anger (before video) Anger (after video)
Aaron 71 75
Bob 68 81
Carl 70 77
... ... ...

Imagine we do the same for females (see the table below).

Females Anger (before video) Anger (after video)
Alice 73 75
Bailey 66 78
Carol 72 76
... ... ...

1st t-test (males): I can use a t-test on the 1st table (males) to determine whether the two columns are significantly different, i.e. did the video make them angry.

1st t-test (females): Exactly the same except using the 2nd table (females).

Conclusions: Let's pretend that both males & females had significantly higher levels of anger after watching the short video.

Question: The short video gets males and females angry. More specifically, the males got more angry by an amount (respectively) of 4,13, and 7. The females have similarly calculated differences. My question is whether Males got more angry than females from watching the short video. So, can I perform a t-test on the two columns below (the difference columns)?

Difference (male) Difference (female)
Subject 1 4 2
Subject 2 13 12
Subject 3 7 4
... ... ...

A significant result would mean that one of the sexes was affected more by the video. A non-significant result would mean that they both were affected about equal. (I know that I am simplifying significance a little bit here)

• Yes, you can run a test to see whether male difference scores are larger than female difference scores. // The question is whether it should be a t test. // If each set of differences is approximately normal, then a t test is probably OK. If not, then maybe a Wilcoxon rank sum test. (But that might get into trouble if there are a lot of ties.) Fortunately, there are yet other possible tests. Can you show some summaries or histograms of your data? // Important to knowhow many males and how many femaies. Nov 2, 2021 at 20:19
• I do not think you are asking about testing for difference between sex's scores. I think you are asking about testing for difference between sex's change in scores (i.e. $\Delta X_i = X_{i,\text{after}}-X_{i,\text{before}}$). Nov 2, 2021 at 22:08
• By the way, I have approx. 20 male data points and 30 female data points. I haven't run any tests (e.g. a qq plot) on these yet, so I am still unsure which tests are available to me. I will be looking at this in a couple of days. Nov 3, 2021 at 15:26

Speculation with fictitious data: If your real data are sufficiently similar in key respects to my fictitious data, then maybe you have your answer. If not, please use what is below to edit your Question, saying what possible difficulties you think might arise with your real data.

Suppose you nave male differences w1 and female differences w2 as summarized below:

summary(w1)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
2.00    5.75    7.00    6.91    8.00   12.00
length(w1); sd(w1)
 100
 2.165361
summary(w2)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
0.000   5.000   6.000   6.007   7.000  10.000
length(w2); sd(w2)
 150
 2.031618

par(mfrow=c(1,2))
qqnorm(w1); qqline(w1, col="blue")
qqnorm(w2); qqline(w2, col="blue")
par(mfrow=c(1,1)) Normal probability plots (quantile-quantile plots) are roughly linear, so it seems OK to compare differences for men and women with a two-sample t test. I will use a Welch version of the test because I can't be sure the variances of the two populations are equal. For my fictitious data, the difference in sample means $$6.9$$ and $$6.0$$ is highly significant with P-value near $$0.$$

t.test(w1,w2)

Welch Two Sample t-test

data:  w1 and w2
t = 3.3117, df = 202.87, p-value = 0.001098
alternative hypothesis:
true difference in means is not equal to 0
95 percent confidence interval:
0.3655023 1.4411643
sample estimates:
mean of x mean of y
6.910000  6.006667


The 'flat sequences' in the normal probability plots indicate numerous ties. But with sample sizes over 100 the implementation of the Wilcoxon rank sum test in R, handles the ties without giving a warning message.

So it would also be OK to use a Wilcoxon rank sum test to see if there is a difference in location of the two populations.

wilcox.test(w1,x2)

Wilcoxon rank sum test
with continuity correction

data:  w1 and x2
W = 0, p-value < 2.2e-16
alternative hypothesis:
true location shift is not equal to 0


The shapes of the two samples is sufficiently similar to say that the medians of the two populations differ. Also the 'notches' in the sides of the boxes do not overlap, which is a further indication of different medians.

boxplot(w1,w2, horizontal=T,
col="skyblue2", notch=T) Note: The fictitious data for this demonstration were sampled in R as below. The rounding gives rise to lots ot ties.

set.seed(12)
w1 = round(rnorm(100, 7, 2.5))
w2 = round(rnorm(150, 6, 2))

• I will have to re-visit this later to study it slowly. If you had time to add any comment here about my sample sizes I would appreciate it later. I have 20 males and 30 females, approximately. I have not checked the qq plots yet. Nov 3, 2021 at 17:43
• With only 20 subjects in each group, you may want to be a little more reluctant to use t tests if data seem far from normal. Also small sample size may make two-sample Wilcoxon test more sensitive to ties. If neither t nor Wilcoxon seems appropriate, then investigate simulated permutation tests. Nov 3, 2021 at 19:13