Two-sample t-test under scenario 1

This is often referred to as the two-sample pooled t-test. If we have two independent samples from two normal distributions with equal variances (σ19602\sigma^{2}_{1960} = σ19902\sigma^{2}_{1990} = σ2\sigma^2 ), the test statistic for the null hypothesis is as follows:

t=(yˉ1960yˉ1990)(μ1960μ1990)1n1960+1n1990spt = \frac{(\bar{y}_{1960} - \bar{y}_{1990}) - (\mu_{1960} - \mu_{1990})}{{\sqrt[sp]{\frac{1}{n_{1960}} + \frac{1}{n_{1990}}}}}

Above, sps_p is the pooled sample standard deviation, computed as follows:

sp=(n19601)s19602+(n19901)s19902n1960+n19902s_p = \frac{(n_{1960} - 1)s^2 _{1960} + (n_{1990} - 1)s^2 _{1990}}{n_{1960} + n_{1990} - 2}

The test statistic follows a t-distribution, with a degree of freedom (n1960n_{1960} + n1990n_{1990} − 2). So, the computed t-statistic, together with the degree of freedom, will allow us to identify the pp value from the t probability distribution table. If the pp value is larger than 0.05 or 5%, the null hypothesis won’t be rejected. If the pp value is smaller than 0.05 or 5%, the null hypothesis will be rejected. The R code for the test is as follows:

Get hands-on with 1200+ tech skills courses.