The T-test

7.3 The T-test

  One major problem with the Z test is that the null hypothesis needs to specify the value of Var( ¯ X). This value is known for Bernoulli random variables, but in general it is unknown. In such a case, we may estimate the variance of the mean using our sample information. To do so first define the sample variance as

  note that the sample variance is a random variable. In the Appendix to this Chapter we prove that the sample variance is an unbiased estimate of the variance of the observations, i.e.,

  E(S 2

  X ) = Var(X i )

  Since S 2

  X is an unbiased estimate of the variance of the observations, we can

  divide it by n to get an unbiased estimate of the variance of the sample mean. We

  represent this estimate as S 2 X ¯

  Now remember the Z random variable was defined as follows

  X ¯ − E( ¯ X |H n true)

  X ¯ − E( ¯ X |H n true)

  Sd( ¯ X |H n true)

  Sd(X |H n true) n

  The T random variable is very similar to the Z random variable except for the fact that in the denominator it uses an estimate of the variance of the mean instead of the true variance

  X ¯ − E( ¯ X |H n true)

  X ¯ − E( ¯ X |H n true)

  T=

  √

  S X ¯

  S X n

  7.3. THE T-TEST

7.3.1 The distribution of T

  The distribution of the T random variable was discovered by William Sealy Gos- set (1876–1937). Gosset was a chemist and mathematician hired by the Guinees brewery in 1899. Brewing is a process in which statistical analysis had great po- tential since brewers have to deal with variable materials, temperature changes and so on. The story goes that at the end of the 19 th century scientific methods and statistical modeling were just beginning to be applied to brewing but the methods available at the time required large numbers of observations. Gosset had to work with experiments with small samples, for which the Z test did not work very well. As a statistician Gosset liked to do everything starting from first principles and disliked the use of recipes and tabulations. This gave him great flexibility and power when tackling new problems. He once said “Doing it from first principles every time preserves mental flexibility”. Gosset was also a very good carpenter, an activity to which he also applied his devotion to first principles; he disliked the use of complicated tools and liked doing as much as possible with a pen-knife. In 1908 Gosset published a paper entitled “The probable error of the mean”, where

  he described the distribution of the T random variable, as a statistic applicable to experiments with small numbers of observations. He published this paper un- der the name “Student”. His desire to remain anonymous gave him a romantic, unassuming reputation. His theoretical distribution became known as the Student- distribution, or simply the T-distribution. In fact there is an infinite number of T-distributions, with each member of the family identified by a parameter known as the degrees of freedom (df ). The probability density function of T is given by the following formula:

  1 u 2

  f T (u) =

  (1 + ) −(df+1)2

  df

  K(df )

  + ∞

  x 2

  K(df ) =

  (1 + ) −(df+1)2 dx

  In practice, we do not need to worry about the formula for f T (u) since the values for the cumulative distribution

  + v

  F T (v) =

  f T (x)dx

  ∞

  appears in most statistics textbooks. Figure 3 shows the shape of the T-distribution with 1 df. The distribution is bell shaped but it has longer tails than the Gaus-

  74 CHAPTER 7. INTRODUCTION TO CLASSIC STATISTICAL TESTS

  Figure 7.1: The t-distribution with one degree of freedom.

  sian distribution. When the number of degrees of freedom is very large, the T- distribution closely approximates the Gaussian distribution.

7.3.2 Two-tailed T-test

  Here is the procedure to perform a two-tailed T-test

  1. Figure out the expected value of the sample mean if the null hypothesis is

  true E( ¯ X |H n true)

  2. Compute T the value taken by T for your specific sample.

  3. Get the degrees of freedom (i.e., number of independent observations) in

  S X ¯ . In our case the number of degrees of freedom is n − 1.

  4. Go to T tables for n − 1 degrees of freedom, and compute the value c such

  that

  P (T > c |H n true) = 140

  The number c is called the critical value.

  5. If T "∈ [−c, c] reject the null hypothesis, otherwise withhold judgment. Example: We get 3 bags of potato chips from a specific brand. The company

  that makes these chips says that on average there are 40 chips per bag. Let X i

  measure the number of chips in bag i. In our sample we have X 1 = 30, X 2 = 10

  7.3. THE T-TEST

  and X 3 = 20. Do we have enough evidence to reject the idea that on average there are 40 chips per bag?

  The null hypothesis is that there are 40 chips per bag. Thus E( ¯ X |H n true) =

  40. Moreover

  ¯ X = (30 + 10 + 20)3 = 20

  5 2 S X ¯ = S 2 X n = 1003 = 5.77

  df = n −1=2

  I obtained the critical value c = 4.30 using the tables of the T statistic with df = 2. Since T ∈ [−4.30, 4.30] we withhold judgment. We do not have enough evidence to reject the null hypothesis.

  Proof: This procedure has the correct type I error specification since

  P (H n rejected |H n true) = P (T "∈[−c, c])

  = 2P (T > c |H n true) = 120

  Procedure for one-tailed T-test In this case the null hypothesis takes an entire range. For example, it could say that the expected value of the mean is smaller than

  20, not just 20. As with the Z test I will use H n to represent the null hypothesis and H x to represent the extreme case in this null hypothesis. For example if the null hypothesis says that the expected value of the mean is smaller than 20, then

  H x says that the expected value of the mean is exactly equal to 20. The procedure to test one-tailed hypotheses is as follows

  1. Formulate the null hypothesis and the extreme hypothesis.

  2. Compute the value of T and df as in the two-tailed case, only in this case

  use expected values given by H x instead of H n .

  3. Using tables find the value c such that P (T > c |H x ) = 120

  76 CHAPTER 7. INTRODUCTION TO CLASSIC STATISTICAL TESTS

  4. If positive values of T are the only ones inconsistent with H n and if T > c

  reject H n . If negative values of T are the only ones inconsistent with H n and if T < −c reject the hypothesis. Otherwise withhold judgment.

  For example if we want to show that the consumers are being cheated. Then we want to reject the hypothesis that the average number of chips is larger or equal to

  40. In such case the null hypothesis is E( ¯ X |H n ) ≥ 40. The extreme case of the

  null hypothesis says E( ¯ X |H x ) = 40. Moreover only negative values of T are

  inconsistent with the null hypothesis. We go to tables and find that for 2 degrees of freedom P (T > −2.91) = 120. Since T = −3.46 is smaller than −2.91, we have enough evidence to reject the null hypothesis.

  Proof: This procedure has the desired type I error specification since

  P (H n rejected |H n true) ≤ P (T "∈ [−c, c] | H x true)

  = 2P (T > c |H x true) = 120

7.3.3 A note about LinuStats

  LinuStats, and some T-tables provide probabilities of the absolute value of T , i.e.,

  P( |T | ≥ c) = P ({−T ≤ c} ∪ {T ≥ c}) = 2P (T ≥ c)

  Thus, if you want to obtain the critical value c such that P (T ≥ c) = x then you need to give LinuStats the value 2x. If you do that LinuStats will give you the value c such that

  P( |T | ≥ c) = 2x

  from which it follows that

  P (T ≥ c) = 2x2 = x

  which is what you wanted to begin with.

Dokumen yang terkait

Analisis Komparasi Internet Financial Local Government Reporting Pada Website Resmi Kabupaten dan Kota di Jawa Timur The Comparison Analysis of Internet Financial Local Government Reporting on Official Website of Regency and City in East Java

19 819 7

Anal isi s L e ve l Pe r tanyaan p ad a S oal Ce r ita d alam B u k u T e k s M at e m at ik a Pe n u n jang S MK Pr ogr a m Keahl ian T e k n ologi , Kese h at an , d an Pe r tani an Kelas X T e r b itan E r lan gga B e r d asarkan T ak s on om i S OL O

2 99 16

ANTARA IDEALISME DAN KENYATAAN: KEBIJAKAN PENDIDIKAN TIONGHOA PERANAKAN DI SURABAYA PADA MASA PENDUDUKAN JEPANG TAHUN 1942-1945 Between Idealism and Reality: Education Policy of Chinese in Surabaya in the Japanese Era at 1942-1945)

1 29 9

Improving the Eighth Year Students' Tense Achievement and Active Participation by Giving Positive Reinforcement at SMPN 1 Silo in the 2013/2014 Academic Year

7 202 3

Improving the VIII-B Students' listening comprehension ability through note taking and partial dictation techniques at SMPN 3 Jember in the 2006/2007 Academic Year -

0 63 87

The Correlation between students vocabulary master and reading comprehension

16 145 49

Improping student's reading comprehension of descriptive text through textual teaching and learning (CTL)

8 140 133

The Effectiveness of Computer-Assisted Language Learning in Teaching Past Tense to the Tenth Grade Students of SMAN 5 Tangerang Selatan

4 116 138

The correlation between listening skill and pronunciation accuracy : a case study in the firt year of smk vocation higt school pupita bangsa ciputat school year 2005-2006

9 128 37

Transmission of Greek and Arabic Veteri

0 1 22