1 of 14

1

The t test

prepared by B.saikiran (12NA1E0036)

2 of 14

Introduction

  • The t-test is a basic test that is limited to two groups. For multiple groups, you would have to compare each pair of groups, for example with three groups there would be three tests (AB, AC, BC), whilst with seven groups there would need to be 21 tests.
  • The basic principle is to test the null hypothesis that the means of the two groups are equal.

3 of 14

ν The t-test assumes:

  • A normal distribution (parametric data)
  • Underlying variances are equal (if not, use Welch's test)
  • It is used when there is random assignment and only two sets of measurement to compare.
  • There are two main types of t-test:
    • Independent-measures t-test: when samples are not matched.
    • Matched-pair t-test: When samples appear in pairs (eg. before-and-after).
  • A single-sample t-test compares a sample against a known figure, for example where measures of a manufactured item are compared against the required standard.

4 of 14

Applications

4

  • To compare the mean of a sample with population mean.
  • To compare the mean of one sample with the mean of another independent sample.
  • To compare between the values (readings) of one sample but in 2

occasions.

5 of 14

5

1.Sample mean and population mean

  • The general steps of testing hypothesis must be followed.
  • Ho: Sample mean=Population mean.

ν Degrees of freedom = n - 1

t = X μ

SE

6 of 14

Example

6

The following data represents hemoglobin values in gm/dl for 10 patients:

10.5 9 6.5 8 11

7 7.5 8.5 9.5 12

Is the mean value for patients significantly differ from the mean value of general population

(12 gm/dl) . Evaluate the role of chance.

7 of 14

Solution

7

ν

Mention all steps of testing hypothesis.

10

Then compare with tabulated value, for 9 df, and 5% level of significance. It is = 2.262

The calculated value>tabulated value.

Reject Ho and conclude that there is a statistically significant difference

between the mean of sample and population mean, and this difference is unlikely due to chance.

1.80201

t = 8.95 12 = 5.352

8 of 14

88

9 of 14

2.Two independent samples

The following data represents weight in Kg for 10 males and 12 females.

Males:

9

80

75

95

55

60

70

75

72

80

65

Females:

60

70

50

85

45

60

80

65

70

62

77

82

10 of 14

2.Two independent samples, cont.

10

  • Is there a statistically significant difference between the mean weight of males and females. Let alpha = 0.01
  • To solve it follow the steps and use this equation.

1 1

2 2

1 1 2 2 (

n1 n2

+ )

n1 + n2 2

(n 1)S + (n 1)S

X 1 X 2

t =

11 of 14

Results

11

ν Mean1=72.7 Mean2=67.17

ν Variance1=128.46 Variance2=157.787

ν Df = n1+n2-2=20

ν t = 1.074

  • The tabulated t, 2 sides, for alpha 0.01 is 2.845
  • Then accept Ho and conclude that there is no significant difference between the 2 means. This difference may be due to chance.

ν P>0.01

12 of 14

3.One sample in two occasions

12

n

sd

t

  • Mention steps of testing hypothesis.
  • The df here = n – 1.

=d

n n 1

( d )2

d 2

sd =

13 of 14

Example: Blood pressure of 8 patients, before & after treatment

BP before

BP after

d d2

180

140

40

1600

200

145

55

3025

230

150

80

6400

240

155

85

7225

170

120

50

2500

190

130

60

3600

200

140

60

3600

165

130

35

1225

Mean d=465/8=58.125

∑d=465

∑d2=2917513

14 of 14

Results and conclusion

14

ν t=9.387

  • Tabulated t (df7), with level of significance 0.05, two tails, = 2.36
  • We reject Ho and conclude that there is significant difference between BP readings before and after treatment.

ν P<0.05.