Lab 4: What is a t-test? Something British mothers use to see if the new girlfriend is significantly better than the old one?

Slides:



Advertisements
Similar presentations
“Students” t-test.
Advertisements

Statistics Review – Part II Topics: – Hypothesis Testing – Paired Tests – Tests of variability 1.
STATISTICAL INFERENCE PART V
STAT E-102 Midterm Review March 14, 2007.
PSY 307 – Statistics for the Behavioral Sciences
Fundamentals of Hypothesis Testing. Identify the Population Assume the population mean TV sets is 3. (Null Hypothesis) REJECT Compute the Sample Mean.
Introduction to Biostatistics, Harvard Extension School © Scott Evans, Ph.D.1 Confidence Intervals.
Section 7.2 Tables and summarize hypothesis tests about one mean. (These tests assume that the sample is taken from a normal distribution,
Lecture 13: Review One-Sample z-test and One-Sample t-test 2011, 11, 1.
Sociology 601 Class 7: September 22, 2009
Inferences About Means of Single Samples Chapter 10 Homework: 1-6.
Hypothesis Tests for Means The context “Statistical significance” Hypothesis tests and confidence intervals The steps Hypothesis Test statistic Distribution.
Business Statistics: A Decision-Making Approach, 7e © 2008 Prentice-Hall, Inc. Chap 10-1 Business Statistics: A Decision-Making Approach 7 th Edition Chapter.
7/2/2015Basics of Significance Testing1 Chapter 15 Tests of Significance: The Basics.
Chapter 11: Inference for Distributions
Chapter 9 Hypothesis Testing.
5-3 Inference on the Means of Two Populations, Variances Unknown
Fall 2012Biostat 5110 (Biostatistics 511) Discussion Section Week 8 C. Jason Liang Medical Biometry I.
Hypothesis Testing and T-Tests. Hypothesis Tests Related to Differences Copyright © 2009 Pearson Education, Inc. Chapter Tests of Differences One.
Chapter 9 Comparing Means
EDUC 200C Section 5–Hypothesis Testing Forever November 2, 2012.
Statistical Inference Dr. Mona Hassan Ahmed Prof. of Biostatistics HIPH, Alexandria University.
 We cannot use a two-sample t-test for paired data because paired data come from samples that are not independently chosen. If we know the data are paired,
Biostat 200 Lecture 5 1. Today Where are we Review of finding percentiles and cutoff values, CLT and 95% confidence intervals Hypothesis testing in general.
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Chapter 9 Hypothesis Testing.
1/2555 สมศักดิ์ ศิวดำรงพงศ์
Hypothesis Testing (Statistical Significance). Hypothesis Testing Goal: Make statement(s) regarding unknown population parameter values based on sample.
Education 793 Class Notes T-tests 29 October 2003.
More About Significance Tests
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Statistical Inferences Based on Two Samples Chapter 9.
STATISTICAL INFERENCE PART VII
Comparing Two Population Means
Section 9.2 Testing the Mean  9.2 / 1. Testing the Mean  When  is Known Let x be the appropriate random variable. Obtain a simple random sample (of.
Introduction to Hypothesis Testing: One Population Value Chapter 8 Handout.
One Sample Inf-1 If sample came from a normal distribution, t has a t-distribution with n-1 degrees of freedom. 1)Symmetric about 0. 2)Looks like a standard.
Week 111 Power of the t-test - Example In a metropolitan area, the concentration of cadmium (Cd) in leaf lettuce was measured in 7 representative gardens.
6.1 - One Sample One Sample  Mean μ, Variance σ 2, Proportion π Two Samples Two Samples  Means, Variances, Proportions μ 1 vs. μ 2.
June 25, 2008Stat Lecture 14 - Two Means1 Comparing Means from Two Samples Statistics 111 – Lecture 14 One-Sample Inference for Proportions and.
Copyright © Cengage Learning. All rights reserved. 10 Inferences Involving Two Populations.
CHAPTER 11 DAY 1. Assumptions for Inference About a Mean  Our data are a simple random sample (SRS) of size n from the population.  Observations from.
Chapter 12 Tests of a Single Mean When σ is Unknown.
Lecture 8 Simple Linear Regression (cont.). Section Objectives: Statistical model for linear regression Data for simple linear regression Estimation.
Chapter 23 Inference for One- Sample Means. Steps for doing a confidence interval: 1)State the parameter 2)Conditions 1) The sample should be chosen randomly.
Confidence intervals and hypothesis testing Petter Mostad
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 8 Hypothesis Testing.
Statistics 101 Chapter 10 Section 2. How to run a significance test Step 1: Identify the population of interest and the parameter you want to draw conclusions.
Lecture 9 Chap 9-1 Chapter 2b Fundamentals of Hypothesis Testing: One-Sample Tests.
Statistical Significance The power of ALPHA. “ Significant ” in the statistical sense does not mean “ important. ” It means simply “ not likely to happen.
1 Objective Compare of two population variances using two samples from each population. Hypothesis Tests and Confidence Intervals of two variances use.
Week111 The t distribution Suppose that a SRS of size n is drawn from a N(μ, σ) population. Then the one sample t statistic has a t distribution with n.
MeanVariance Sample Population Size n N IME 301. b = is a random value = is probability means For example: IME 301 Also: For example means Then from standard.
AP Statistics Unit 5 Addie Lunn, Taylor Lyon, Caroline Resetar.
© Copyright McGraw-Hill 2004
Applied Quantitative Analysis and Practices LECTURE#14 By Dr. Osman Sadiq Paracha.
1-Sample t-test Amir Hossein Habibi.
Statistical Inference Statistical inference is concerned with the use of sample data to make inferences about unknown population parameters. For example,
© 2010 Pearson Prentice Hall. All rights reserved Chapter Hypothesis Tests Regarding a Parameter 10.
+ Unit 6: Comparing Two Populations or Groups Section 10.2 Comparing Two Means.
Lecture 8 Estimation and Hypothesis Testing for Two Population Parameters.
Chapter 7 Inference Concerning Populations (Numeric Responses)
 What is Hypothesis Testing?  Testing for the population mean  One-tailed testing  Two-tailed testing  Tests Concerning Proportions  Types of Errors.
Statistical hypothesis Statistical hypothesis is a method for testing a claim or hypothesis about a parameter in a papulation The statement H 0 is called.
16/23/2016Inference about µ1 Chapter 17 Inference about a Population Mean.
4-1 Statistical Inference Statistical inference is to make decisions or draw conclusions about a population using the information contained in a sample.
Independent Samples: Comparing Means Lecture 39 Section 11.4 Fri, Apr 1, 2005.
business analytics II ▌assignment one - solutions autoparts 
Hypothesis Testing: Hypotheses
Hypothesis Tests for a Population Mean in Practice
Chapter 9 Hypothesis Testing
Chapter 9 Hypothesis Testing.
Presentation transcript:

Lab 4: What is a t-test? Something British mothers use to see if the new girlfriend is significantly better than the old one?

The t Distribution  We want to compute a confidence interval & test a hypothesis for an unknown population mean µ  To use the Z distribution we must know the population standard deviation σ  In most real life situations, we don’t know the true population standard deviation  In this case we can use the t distribution instead of the Z distribution to calculate confidence intervals & test hypotheses It seems the more we learn the less we know!

T vs. Z Distribution: Who’s who? T Distribution: Unimodal & symmetric around zero Use when population µ & σ are both UNKNOWN Assumes variable of interest is normally distributed Using sample S.D. introduces more sampling variability Heavier tails (n-1) degrees of freedom Z Distribution (CLT): Unimodal & symmetric around zero Use when population µ is UNKNOWN but σ is KNOWN CLT allows us to say the sampling distribution of the mean is approx. normal as n gets large, even when the underlying variable of interest is not normally distributed Smaller tails

T vs. Z Distribution: Who’s who?

The t Distribution  Assumptions: The variable (X) is normally distributed Random sample of size n from the underlying population Very similar to Z distribution as sample size gets “large” (30+) (n-1) degrees of freedom

Degrees of Freedom: (n-1)  The “Currency” of statistics - you earn a degree of freedom for every data point you collect, and you spend a degree of freedom for each parameter you estimate. Since you usually need to spend 1 just to calculate the mean, you then are left with n-1 (total data points "n" - 1 spent on calculating the mean). (Reference:  A general rule is that the degrees of freedom decrease when we have to estimate more parameters.  Before you can compute the standard deviation, you have to first estimate a mean.  This causes you to lose a degree of freedom (Reference: Two statistics are in a bar, talking and drinking. One statistic turns to the other and says "So how are you finding married life?" The other statistic responds, "It's okay, but you lose a degree of freedom."

STATA & the one sample t-test

STATA Options  Get t critical value: display invttail(df,p) Used for CI & Hypothesis Tests  Get p-value: display ttail(df,t) (one-sided) display tprob(df,t) (two-sided)  Run t-test from data summary: Useful for summary homework problems ttesti n x_bar s µ  Run t-test on actual data: Useful in real-life research ttest varname= µ

STATA: obtaining the critical value  Example: Concentration of benzene in cigars  Hypothesis Test: 2-sided test Null Hypothesis: μ=81 μg/g vs. Alternative Hypothesis: μ≠81 μg/g Standard deviation is unknown α= 0.05 (two-sided test)  Data: Sample mean= 151 μg/g Sample Standard deviation, s=9 μg/g d.f. = n-1 = 7-1 = 6  The STATA command: invttail(df,p) where df is the degrees of freedom and p is a number between 0 and 1. display invttail(6,0.025) This means that if T statistic is above or below –2.447, then we would reject the null hypothesis at the 5% alpha level. Since the observed value of the statistic T is 20.6, we reject the null hypothesis. t=

Note of Confusion!  Note! invnorm(p) returns the inverse cumulative standard normal distribution [i.e. returns z which satisfies P(Z ≤ z)=p] invttail(df,p) returns the inverse REVERSE cumulative Student's t distribution [i.e. returns t which satisfies P(T ≥ t)=p)] So instead of using invttail(6,0.975) we should use invttail(6,0.025)

STATA: obtaining the p-value  Use: ttail(df,t) (one-sided) or tprob(df,t) (two-sided) display ttail(6,20.6) 4.257e-07  This gives you P(T ≥ 20.6). To obtain the p-value for this two-sided test, we have p=P(|T| ≥ 20.6) = P(T ≥ 20.6 or T ≤ -20.6)=2*P(T ≥ 20.6)= 8.513e-07.  While tprob will give you P(|T| ≥ t) directly: display tprob(6,20.6) 8.513e-07

STATA: running one-sample t-test from summary statistics  ttesti n x_bar s µ  Null Hypothesis: μ=81 μg/g vs. Alternative Hypothesis: μ≠81 μg/g Data: Sample mean= 151 μg/g (x_bar) Sample Standard deviation, s=9 μg/g d.f. = n-1 = 7-1 = 6 ttesti

STATA Output  One-sample t test   | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]   x |   Degrees of freedom: 6  Ho: mean(x) = 81  Ha: mean 81  t = t = t =  P |t| = P > t =

STATA: running one-sample t-test on data  Open lowbwt.dta contained on the disk in your book. If you wish to test a hypothesis regarding the population mean of the gestation age of low birth weight infants (for example: you might hypothesize that low birth infants have gestation ages greater than 28 weeks). To test this one- sided hypothesis: H0: mean <= 28 H1: mean > 28 Alpha-level = 0.05 You would use the following STATA command: ttest gestage = 28

STATA Output  One-sample t test   Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]   gestage |   Degrees of freedom: 99  Ho: mean(gestage) = 28  Ha: mean 28  t = t = t =  P |t| = P > t =  STATA writes out two-sided and one-sided hypotheses. In this case, we would be employing the one on the right (Ha: mean>28). Since the p-value is which is less than our alpha-level of 0.05, we would reject the null hypothesis and conclude that the mean gestation age is not less than 28 weeks.

STATA: two sample t-test & paired t-test Next Week…