The t-test

  • how likely is it that the two sample means were drawn from populations with the same average?
  • calculate a test statistic
  • how likely that we obtain a test statistic this big or bigger if the null hypothesis is true
    • compare the calculated test statistic to the critical value which is calculated on the assumption that the null hypothesis is true
  • quick test: what is the null hypothesis when comparing two means?

The t-test

  • t = \(\frac{difference\, between\, two\, means}{standard\, error\, of\, the\, difference}\)

  • t = \(\frac{\bar{y}_A-\bar{y}_B}{S.E.D}\)

  • Lecture 3 explains the standard error of the mean (an estimate of how far the sample mean is likely to be from the population mean)

  • For two independent variables, the variance of a difference is the sum of the separate variances

  • \(S.E.M =\sqrt{\frac{s^2}{n}}\)

  • \(S.E.D =\sqrt{\frac{s_A^2}{n_A}+\frac{s_B^2}{n_B}}\)

  • t = \(\frac{\bar{y}_A-\bar{y}_B}{\sqrt{\frac{s_A^2}{n_A}+\frac{s_B^2}{n_B}}}\)

Chi squared contingency table

Blue.eyes Brown.eyes Row.totals
Fair hair 38 11 49
Dark hair 14 51 65
Column totals 52 62 114
  • counts (number of leaves, number of patients who dies etc.)
  • Is there an association between hair colour and eye colour?
  • Calculate expected value based on null hypothesis (Ho: There is no association between hair and eye colour)
  • expected = (row total x column total) / grand total
  • \(\chi^2 = \sum\frac{(O-E)^2}{E}\)
  • d.f. = (r-1) x (c-1)