# two-sample t-test for gender difference in heart rate increase after exercise. If investigating the effect of exercise on the heart rate of two groups (males and females) how would one calculate...

two-sample t-test for gender difference in heart rate increase after exercise.

If investigating the effect of exercise on the heart rate of two groups (males and females) how would one calculate the difference between them?

How would I employ a t-test to determine if there is an effect due to gender on heart rate increase after exercise?

### 1 Answer | Add Yours

Call the measured difference before and after exercise `d_m` for the males and `d_f` for the females. These should be within-person differences to get a useful measurement. To correct for fitness level (the difference in heart rate may be larger for unfit persons, but if more women tend to be unfit the result will only show this and not the sole effect of gender) group the people in each gender group into `I` quantiles - at least three I would say (high fitness, medium fitness, low fitness). Doing this you should immediately notice whether these fitness distributions look different for the two sexes - if it is very clear that they are not, then the stratification is pointless and proceed without doing it!

Each quantile `i` will provide a difference between the male and female increases in heart rate `d_(fi)-d_(mi)` (this way round will probably be positive?).

The t-statistic for each quantile will be

`t_i = (d_(fi)-d_(mi))/(hat(s)_p(i)sqrt(1/n_(fi) + 1/n_(mi)))`

where `n_(fi)` and `n_(mi)` are the number of females and males respectively in the quantile and where `hat(s)_p(i)` is the pooled estimate of the standard deviation of differences in heart rates in each quantile:

`hat(s)_p = sqrt(((n_(fi)-1) s_(fi)^2 + (n_(mi)-1)s_(mi)^2)/(n_(fi) + n_(mi)-2)))`

If the numbers in the `I` quantiles are generally small, these estimates of the standard deviation in heart rate differences within quantile are going to be poor!

The degrees of freedom for each of the `I` t-statistics calculated will be `(n_(fi)+n_(mi)-2)`. To test the difference between men and women in all of the quantiles be careful to correct the type I error to account for the number of tests being performed.

A better route is to use the method of two-way ANOVA (analysis of variance) which uses an F-test (RA Fisher).

**I would suggest using multiple t-tests if going this route to stratify by fitness level within gender. However, performing a two-way ANOVA is a more sensible approach.**

**Sources:**