1 / 20

How to do T-test?

How to do T-test?. Cindy Wu. Population means, independent samples. *. Use a Z test statistic. σ 1 and σ 2 known. Use S p to estimate unknown σ , use a t test statistic and pooled standard deviation. σ 1 and σ 2 unknown, assumed equal.

cbethany
Download Presentation

How to do T-test?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to do T-test? Cindy Wu

  2. Population means, independent samples * Use a Z test statistic σ1 and σ2 known Use Sp to estimate unknown σ , use a t test statistic and pooled standard deviation σ1 and σ2 unknown, assumed equal Use S1 and S2 to estimate unknown σ1 and σ2, use a separate-variance t test σ1 and σ2 unknown, not assumed equal Difference Between Two Means Source: Mark L, Berenson, David M. Levine, Timonthy C. Levine, Basic Business Statistics– Concepts and Applications, 10rd Edition, 2005

  3. When is T-test performed? • To compare the means between two groups • One-tail T-test • μ1 ≧ μ2 orμ1 ≤μ2 • ex: Foreign students have higher grade than local students • Two-tail T-test • μ1 ≠μ2 • ex: the performance between foreign and local students are different.

  4. Lower-tail test: H0: μ1 – μ2≧ 0 H1: μ1 – μ2< 0 Upper-tail test: H0: μ1 – μ2≤ 0 H1: μ1 – μ2> 0 Two-tail test: H0: μ1 – μ2= 0 H1: μ1 – μ2≠ 0 a a a/2 a/2 -ta ta -ta/2 ta/2 Reject H0 if t < -ta Reject H0 if t > ta Reject H0 if t < -ta/2 or t > ta/2 Where t has n - 1 d.f. Hypothesis Testing for Mean Difference, σD Unknown Source: Mark L, Berenson, David M. Levine, Timonthy C. Levine, Basic Business Statistics– Concepts and Applications, 10rd Edition, 2005

  5. Hypothesis • Hypothesis 0: Gender differences have no influence on the preference toward chocolate • Hypothesis 1: Gender differences have influence on the preference toward chocolate

  6. T-test step1: The test of variance (F-test) • To test if the variances of the two groups are equal • If the p-value of F value (Pr > F ) >α=0.05, the variances are equal • Equal variance: pooled method • If the p-value of F value (Pr > F ) <α=0.05, the variances are unequal • Unequal variance: Satterthwaite method

  7. T-test step2: T-test • To test if the hypothesis 1 is accepted. • If the p-value of T value (Pr > |t|) >α=0.05, H0 is accepted • Gender differences have no influence on the preference toward chocolate • If the p-value of T value (Pr > |t|) <α=0.05, H0 is rejected • Gender differences do have influence on the preference toward chocolate

  8. Example (SAS) Please open Tim’s HW

  9. Common Mistakes • Didn’t check if the variance is equal or not first • T-test can’t be used to find the reason • Why do people ride bike? For convenience? For health? • Use pair T-test to test two different groups • When using Excel, don’t know how to interpret the result

  10. Examples: • Marital Status • Political Party • Eye Color (Defined categories) Examples: • Number of Children • Defects per hour (Counted items) Examples: • Weight • Grades (Measured characteristics) Types of Data Source: Mark L, Berenson, David M. Levine, Timonthy C. Levine, Basic Business Statistics– Concepts and Applications, 10rd Edition, 2005

  11. EXAMPLES: Height, Age, Weekly Food Spending Ratio Data Differences between measurements, true zero exists Temperature in Fahrenheit, Standardized exam score Interval Data Differences between measurements but no true zero Service quality rating, Standard & Poor’s bond rating, Student letter grades Ordinal Data Ordered Categories (rankings, order, or scaling) Marital status, Type of car owned Nominal Data Categories (no ordering or direction) Levels of Measurementand Measurement Scales Source: Mark L, Berenson, David M. Levine, Timonthy C. Levine, Basic Business Statistics– Concepts and Applications, 10rd Edition, 2005

  12. Two-Sample Tests in EXCEL For independent samples: • Independent sample Z test with variances known: • Tools | data analysis | z-test: two sample for means • Pooled variance t test: • Tools | data analysis | t-test: two sample assuming equal variances • Separate-variance t test: • Tools | data analysis | t-test: two sample assuming unequal variances For paired samples (t test): • Tools | data analysis | t-test: paired two sample for means For variances: • F test for two variances: • Tools | data analysis | F-test: two sample for variances Source: Mark L, Berenson, David M. Levine, Timonthy C. Levine, Basic Business Statistics– Concepts and Applications, 10rd Edition, 2005

  13. Example (Excel)

  14. Example (SPSS)

  15. Hypothesis • Hypothesis 0: Gender differences have no influence on the preference toward chocolate • Hypothesis 1: Gender differences have influence on the preference toward chocolate

  16. Table 1. Descriptive statistics

  17. Table 2. T-test results (SPSS) P-value <0.05 Ho is rejected. So the gender differences have influence on the preference toward chocolate

  18. Thanks.

  19. Test for the Difference in 2 Independent Populations Parametric Test Procedure Assumptions Both populations are normally distributed Test is not robust to this violation Samples are randomly and independently drawn F distribution Source: Mark L, Berenson, David M. Levine, Timonthy C. Levine, Basic Business Statistics– Concepts and Applications, 10rd Edition, 2005

  20. Hypothesis Tests for Variances * Tests for Two Population Variances H0: σ12 = σ22 H1: σ12 ≠ σ22 Two-tail test F test statistic H0: σ12≧σ22 H1: σ12 < σ22 Lower-tail test H0: σ12 ≤ σ22 H1: σ12 > σ22 Upper-tail test

More Related