I think the most straight forward approach (keep in mind there are several ways to skin this cat) is to perform a simple regression analysis on the difference in pre- and post-test scores with a single independent dummy variable for gender.
So for example, you'd want to preprocess your data and obtain $y_{diff_i}=y_{pre_i}-y_{post_i}$ for the $i$th subject $i=1$ to $39$. Then simply fit the model:
$y_{diff_i}=\beta_0+\beta_{gender}X_{gender_i}+\epsilon_i$
If you are interested in testing for a gender effect, you'd test whether:
$H_0: \hat{\beta}_{gender}=0$ vs. $H_1: \hat{\beta}_{gender}\ne0$.
Then, assuming there's no gender effect, to determine if there was a statistically significant difference between the pre and post tests, you simply test whether:
$H_0: \hat{\beta}_0=0$ vs. $H_1: \hat{\beta}_0\ne0$.
If you do find an important gender effect, you'd want to go about determining the average increase in score for each gender separately with the use of a contrast. Assuming men are coded 1 and women are coded 0, then estimated pre-post change for men becomes:
$\hat{\beta}_0+\hat{\beta}_{gender}$
and the average pre-post test change for women is estimated by just $\hat{\beta}_0$.
So continuing with your toy example, in R this could be fit as follows:
> y_diff=pre-post
> myfit<-lm(y_diff~gender)
> summary(myfit)
Call:
lm(formula = y_diff ~ gender)
Residuals:
Min 1Q Median 3Q Max
-4.1334 -0.9911 0.4681 1.1861 2.4989
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3.1081 0.4209 -7.385 8.75e-09 ***
gender -0.3158 0.5480 -0.576 0.568
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.683 on 37 degrees of freedom
Multiple R-squared: 0.008892, Adjusted R-squared: -0.01789
F-statistic: 0.332 on 1 and 37 DF, p-value: 0.568
Of course, you'll need to carry out the usual model diagnostics and such, but I think you are familiar with those details.
Other possible methods include fitting a model and adjusting for the pre-test score as well as gender:
$y_{post_i}=\beta_0+\beta_{gender}X_{gender_i}+\beta_{pre}Y_{pre_i}+\epsilon_i$. See the first comment by rolando2 for more info on a model like this.
R? – rnorouzian Jan 04 '19 at 19:42