# Which test to use when t-test is not apropriate?

I have two groups, male and female teachers. I want to see if there is a statistically significant difference in mean pay.

There are 48 male teachers, which is enough to use a t-test. However, there are only 23 female teachers, and further, the distribution of female pay is right skewed.

What are my options for a test?

Could I:

1. resample female teacher pay to get 48 values, then do a t-test?
2. select only 23 male teachers, then shuffle the pay values to create a null randomization distribution and then compare the mean difference to look for statistical signifigance?
3. some other method?

Your questions seem to be predicated on either misunderstanding or misinformation.

What is the basis for deciding that you can use a t-test with 48 values but not 23?
-- You can use t-tests with a lot fewer than 23 observations with no problem, or face serious problems with more than 48 -- depending on the situation. Why draw a line between 23 and 48? What's the basis for it?

1. How would resampling help? Resampling won't change how much information you have.

2. Why would you throw data away? There's nothing stopping you using permutation, randomization or bootstrap tests with 48 in one of the groups and 23 in the other.

3. Other methods might be reasonable; in part it might depend on knowing more about your circumstances.

• Thanks for the response, I'm sure I'm missing something. If I bootstrap – compguy24 Nov 15 '14 at 14:47
• Did your comment get cut off? – Glen_b -Reinstate Monica Nov 15 '14 at 15:16
• Yes, I was able to do it with a bootstrap alright. – compguy24 Nov 16 '14 at 1:49
• With small samples I'd worry more about the coverage (and hence actual significance level) of the bootstrap than I would about the coverage of the t-test. – Glen_b -Reinstate Monica Nov 16 '14 at 2:00
• For salaries - which are clearly non-negative and therefore non-Normal - you might want to consider taking logs. – user20637 Nov 17 '14 at 10:13

There is no reason an independent samples t-test wouldn't work in the situation you're describing. Equal group size is only necessary for paired sample t-tests, which would be inappropriate in this case--equal sample size would only matter if you were trying to compare the same teachers in two separate conditions.The question you're asking can be described by the following model:

$Pay_i = \beta_0 + \beta_1 Gender_i + \epsilon_i$

where $Gender$ is a binary variable describing the gender of each teacher. Your test statistic would correspond to a test of the parameter $\beta_1$. In other word, does gender significantly improve our ability to predict pay.

In R:

dat <- data.frame(pay,gender)
model <- lm(pay ~ gender,data = dat) #specify model
summary(mod)$coefficients #examine the parameter estimate and test-statistics for gender  or equivalently: t.test(dat$pay[dat$gender==0],dat$pay[dat$gender==1],var.equal=T)  assuming you have coded gender as zeros and ones and that their are no substantial differences in variance in pay between gender. If that is not the case, you could use a Welch two-sample t-test: t.test(dat$pay[dat$gender==0],dat$pay[dat\$gender==1],var.equal=F)