The t-distribution. Patrick Breheny. October 13. z tests The χ 2 -distribution The t-distribution Summary

Similar documents
The t-test Pivots Summary. Pivots and t-tests. Patrick Breheny. October 15. Patrick Breheny Biostatistical Methods I (BIOS 5710) 1/18

One-sample categorical data: approximate inference

Two-sample Categorical data: Testing

Multiple samples: Modeling and ANOVA

The normal distribution

The Central Limit Theorem

Two-sample inference: Continuous data

Epidemiology Principles of Biostatistics Chapter 10 - Inferences about two populations. John Koval

Power and sample size calculations

Business Statistics: Lecture 8: Introduction to Estimation & Hypothesis Testing

Biostatistics and Design of Experiments Prof. Mukesh Doble Department of Biotechnology Indian Institute of Technology, Madras. Lecture 11 t- Tests

BIO5312 Biostatistics Lecture 6: Statistical hypothesis testings

Two-sample Categorical data: Testing

Purposes of Data Analysis. Variables and Samples. Parameters and Statistics. Part 1: Probability Distributions

PHP2510: Principles of Biostatistics & Data Analysis. Lecture X: Hypothesis testing. PHP 2510 Lec 10: Hypothesis testing 1

7 Estimation. 7.1 Population and Sample (P.91-92)

Bias Variance Trade-off

Ch. 7. One sample hypothesis tests for µ and σ

Confidence intervals CE 311S

Descriptive statistics

Lecture 5: ANOVA and Correlation

Two-sample inference: Continuous data

Chapter 8. Linear Regression. The Linear Model. Fat Versus Protein: An Example. The Linear Model (cont.) Residuals

Chapter 24. Comparing Means. Copyright 2010 Pearson Education, Inc.

AMS7: WEEK 7. CLASS 1. More on Hypothesis Testing Monday May 11th, 2015

Advanced Herd Management Probabilities and distributions

Statistical Intervals (One sample) (Chs )

Probability. We will now begin to explore issues of uncertainty and randomness and how they affect our view of nature.

Normal (Gaussian) distribution The normal distribution is often relevant because of the Central Limit Theorem (CLT):

Chapter 8. Linear Regression. Copyright 2010 Pearson Education, Inc.

Lecture 8 Sampling Theory

IV. The Normal Distribution

Semiparametric Regression

Space Telescope Science Institute statistics mini-course. October Inference I: Estimation, Confidence Intervals, and Tests of Hypotheses

Institute of Actuaries of India

Lecture 12: Small Sample Intervals Based on a Normal Population Distribution

Chapter 23. Inferences About Means. Monday, May 6, 13. Copyright 2009 Pearson Education, Inc.

Section 9.4. Notation. Requirements. Definition. Inferences About Two Means (Matched Pairs) Examples

Test 3 Practice Test A. NOTE: Ignore Q10 (not covered)

II. The Normal Distribution

STA Module 10 Comparing Two Proportions

Difference between means - t-test /25

Chapter 5: HYPOTHESIS TESTING

MVE055/MSG Lecture 8

Lecture 17: Small-Sample Inferences for Normal Populations. Confidence intervals for µ when σ is unknown

Statistical methods for comparing multiple groups. Lecture 7: ANOVA. ANOVA: Definition. ANOVA: Concepts

Lecture 3. Biostatistics in Veterinary Science. Feb 2, Jung-Jin Lee Drexel University. Biostatistics in Veterinary Science Lecture 3

Quantitative Analysis and Empirical Methods

CENTRAL LIMIT THEOREM (CLT)

a Sample By:Dr.Hoseyn Falahzadeh 1

Introduction to Statistical Inference

Interval estimation. October 3, Basic ideas CLT and CI CI for a population mean CI for a population proportion CI for a Normal mean

Notes on the Multivariate Normal and Related Topics

INTERVAL ESTIMATION AND HYPOTHESES TESTING

Count data and the Poisson distribution

One-parameter models

STT 843 Key to Homework 1 Spring 2018

T has many other desirable properties, and we will return to this example

Review of Statistics 101

Statistical Inference

Testing Independence

This does not cover everything on the final. Look at the posted practice problems for other topics.

Null Hypothesis Significance Testing p-values, significance level, power, t-tests Spring 2017

Lab #11. Variable B. Variable A Y a b a+b N c d c+d a+c b+d N = a+b+c+d

15 Discrete Distributions

One sided tests. An example of a two sided alternative is what we ve been using for our two sample tests:

Probability Theory and Statistics. Peter Jochumzen

Simple Linear Regression

Censoring mechanisms

z and t tests for the mean of a normal distribution Confidence intervals for the mean Binomial tests

Chapter 12: Inference about One Population

IV. The Normal Distribution

Statistical Inference

Lab #12: Exam 3 Review Key

Probability theory and inference statistics! Dr. Paola Grosso! SNE research group!! (preferred!)!!

Chapter 10. Hypothesis Testing (I)

Lecture 10: Generalized likelihood ratio test

Statistical Inference with Regression Analysis

STAT 4385 Topic 01: Introduction & Review

Last week: Sample, population and sampling distributions finished with estimation & confidence intervals

Quantitative Introduction ro Risk and Uncertainty in Business Module 5: Hypothesis Testing

Probability Methods in Civil Engineering Prof. Dr. Rajib Maity Department of Civil Engineering Indian Institution of Technology, Kharagpur

Math 494: Mathematical Statistics

ADJUSTED POWER ESTIMATES IN. Ji Zhang. Biostatistics and Research Data Systems. Merck Research Laboratories. Rahway, NJ

Correlation. Patrick Breheny. November 15. Descriptive statistics Inference Summary

Confidence intervals

Advanced Experimental Design

appstats8.notebook October 11, 2016

2008 Winton. Statistical Testing of RNGs

Review of One-way Tables and SAS

Mathematical statistics

Samples and Populations Confidence Intervals Hypotheses One-sided vs. two-sided Statistical Significance Error Types. Statistiek I.

Last two weeks: Sample, population and sampling distributions finished with estimation & confidence intervals

Hypothesis testing I. - In particular, we are talking about statistical hypotheses. [get everyone s finger length!] n =

Class 24. Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science. Marquette University MATH 1700

Lecture 30. DATA 8 Summer Regression Inference

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

HYPOTHESIS TESTING. Hypothesis Testing

Chapter 10: Inferences based on two samples

Lecture 26: Chapter 10, Section 2 Inference for Quantitative Variable Confidence Interval with t

Transcription:

Patrick Breheny October 13 Patrick Breheny Biostatistical Methods I (BIOS 5710) 1/25

Introduction Introduction What s wrong with z-tests? So far we ve (thoroughly!) discussed how to carry out hypothesis tests and construct confidence intervals for categorical outcomes: success versus failure, life versus death This week we ll turn our attention to continuous outcomes like blood pressure, cholesterol, etc. We ve seen how continuous data must be summarized and plotted differently, and how continuous probability distributions work very differently from discrete ones It should come as no surprise, then, that there are also big differences in how these data must be analyzed Patrick Breheny Biostatistical Methods I (BIOS 5710) 2/25

Notation Introduction What s wrong with z-tests? We ll use the following notation: The true population mean is denoted µ The observed sample mean is denoted either x or ˆµ For hypothesis testing, H 0 is shorthand for the null hypothesis, as in H 0 : µ = µ 0 Unlike the case for binary outcomes, we also need some notation for the standard deviation: The true population variance is denoted σ 2 (i.e. σ is the SD) The observed sample variance is denoted ˆσ 2 or s 2 : i ˆσ 2 = (x i x) 2, n 1 with ˆσ and s the square root of the above quantity Patrick Breheny Biostatistical Methods I (BIOS 5710) 3/25

Using the central limit theorem Introduction What s wrong with z-tests? We ve already used the central limit theorem to construct confidence intervals and perform hypothesis tests for categorical data The same logic can be applied to continuous data as well, with one wrinkle For categorical data, the parameter we were interested in (p) also determined the standard deviation: p(1 p) For continuous data, the mean tells us nothing about the standard deviation Patrick Breheny Biostatistical Methods I (BIOS 5710) 4/25

Estimating the standard error Introduction What s wrong with z-tests? In order to perform any inference using the CLT, we need a standard error We know that SE = SD/ n, so it seems reasonable to estimate the standard error using the sample standard deviation as a stand-in for the population standard deviation This turns out to work decently well for large n, but as we will see, has problems when n is small Patrick Breheny Biostatistical Methods I (BIOS 5710) 5/25

FVC example Introduction What s wrong with z-tests? Let s revisit the cystic fibrosis crossover study that we ve discussed a few times now, but instead of focusing on whether the patient did better on drug or placebo (a categorical outcome), let us now focus on how much better the patient did on the drug: 600 Difference in FVC reduction 400 200 0 200 Let s carry out a z-test for this data, plugging in ˆσ for σ Patrick Breheny Biostatistical Methods I (BIOS 5710) 6/25

FVC example (cont d) Introduction What s wrong with z-tests? In the study, the mean difference in reduction in FVC (placebo drug) was 137, with standard deviation 223 Performing the z-test of H 0 : µ = 0: #1 SE = 223/ 14 = 60 #2 z = 137 0 60 = 2.28 #3 The area outside ±2.28 is 2Φ( 2.28) = 2(0.011) = 0.022 This is fairly substantial evidence that the drug helps prevent deterioration in lung function Patrick Breheny Biostatistical Methods I (BIOS 5710) 7/25

Flaws with the z-test Introduction What s wrong with z-tests? However, as I mentioned before, these procedures are flawed when n is small This is a completely separate flaw than the issue of how accurate is the normal approximation? in using the central limit theorem Indeed, this is a problem even when the sampling distribution is perfectly normal This flaw can be witnessed by repeatedly drawing random samples from the normal distribution, then carrying out this test and recording the type I error rate Patrick Breheny Biostatistical Methods I (BIOS 5710) 8/25

Simulation results Introduction What s wrong with z-tests? Using p < 0.05 as a rejection rule: 30 25 Type I error rate 20 15 10 5 0 5 10 15 20 25 30 n What would a simulation involving confidence intervals look like? Patrick Breheny Biostatistical Methods I (BIOS 5710) 9/25

Why isn t the z-test working? Introduction What s wrong with z-tests? The flaw with the z-test is that it is ignoring one of the sources of the variability in the test statistic We re acting as if we know the standard error, but we re really just estimating it from the data In doing so, we underestimate the amount of uncertainty we have about the population based on the data Patrick Breheny Biostatistical Methods I (BIOS 5710) 10/25

Distribution of the sample variance Before we get into the business of fixing the z-test, we need to discuss a more basic issue: what does the sampling distribution of the variance look like? We have this beautiful central limit theorem describing what the sampling distribution of the mean looks like for any underlying distribution Unfortunately, there is no corresponding theorem for the sample variance Patrick Breheny Biostatistical Methods I (BIOS 5710) 11/25

Special case: The normal distribution We may, however, consider the important special case of the normal distribution If the underlying distribution is normal, we can derive many useful results concerning the sample variance Keep in mind, however, that unlike the results we established in the central limit theorem lecture, these results only apply to random variables that follow a normal distribution Patrick Breheny Biostatistical Methods I (BIOS 5710) 12/25

The χ 2 distribution An important distribution highly related to the normal distribution is the χ 2 -distribution Suppose Z N(0, 1); then Z 2 is said to follow a χ 2 1 distribution, with pdf: f(x) = 1 2π x 1/2 e x/2 2.0 1.5 Density 1.0 0.5 0.0 0 1 2 3 4 x Patrick Breheny Biostatistical Methods I (BIOS 5710) 13/25

The χ 2 distribution: Degrees of freedom An important generalization is to consider sums of squared observations from the normal distribution Suppose Z 1, Z 2,..., Z p N(0, 1) and are mutually independent; then p i=1 Z2 i is said to follow a chi-squared distribution with p degrees of freedom, denoted χ 2 p: f(x) = Density (10 df) 0.10 0.08 0.06 0.04 0.02 0.00 1 Γ(p/2)2 p/2 xp/2 1 e x/2 0 5 10 15 20 25 30 x Patrick Breheny Biostatistical Methods I (BIOS 5710) 14/25

Distribution of the sample variance (normal case) From the previous slide, it immediately follows that if X 1, X 2,..., X n N(µ, σ 2 ) are mutually independent, then n ( ) Xi µ 2 χ 2 n σ i=1 In other words, letting S = (x i µ) 2 /n, we have n S 2 /σ 2 χ 2 n It can also be shown (not so immediately) that if X 1, X 2,..., X n N(µ, σ 2 ) are mutually independent, then (n 1)S 2 /σ 2 χ 2 n 1 Patrick Breheny Biostatistical Methods I (BIOS 5710) 15/25

Independence of mean and variance By working out the joint distribution of X and X 2 X, X 3 X,..., X n X, we also arrive at the useful conclusion that the sampling distributions of X and S 2 are independent In other words, for normally distributed variables, the mean and variance have no relationship whatsoever This is obviously not true for other distributions for example, we saw that the binomial distribution has Var(X) = ne(x)(1 E(X)) Patrick Breheny Biostatistical Methods I (BIOS 5710) 16/25

Distribution of the sample mean (normal case) Finally, it is worth mentioning that when a random variable follows a normal distribution, the distribution of its sample mean is exactly normal (i.e., the central limit theorem is an exact result, not an approximation) More formally, suppose X 1, X 2,..., X n N(µ, σ 2 ) are mutually independent; then n X µ σ N(0, 1) Patrick Breheny Biostatistical Methods I (BIOS 5710) 17/25

Revisiting our earlier test statistic When we carried out our z-test from earlier, we looked at the quantity X µ S/ n and acted as if it followed a normal distribution But of course, it really doesn t: the numerator is normal, but then we re dividing it by another random variable Patrick Breheny Biostatistical Methods I (BIOS 5710) 18/25

The problem of What is the resulting distribution when you divide one random variable by another? was studied by a statistician named W. S. Gosset, who showed the following Suppose that Z N(0, 1), X 2 χ 2 n, and that Z and X 2 are independent; then Z X 2 /n t n, the t-distribution with n degrees of freedom Patrick Breheny Biostatistical Methods I (BIOS 5710) 19/25

t-distribution vs. normal distribution, df = 4 Normal t Density 0.0 0.1 0.2 0.3 0.4 0.5 4 2 0 2 4 Patrick Breheny Biostatistical Methods I (BIOS 5710) 20/25

t-distribution vs. normal distribution, df = 14 Normal t Density 0.0 0.1 0.2 0.3 0.4 0.5 4 2 0 2 4 Patrick Breheny Biostatistical Methods I (BIOS 5710) 21/25

t-distribution vs. normal distribution, df = 99 Normal t Density 0.0 0.1 0.2 0.3 0.4 0.5 4 2 0 2 4 Patrick Breheny Biostatistical Methods I (BIOS 5710) 22/25

t-distribution vs. normal distribution There are many similarities between the normal curve and Student s curve: Both are symmetric around 0 Both have positive support over the entire real line As the degrees of freedom go up, the t-distribution converges to the normal distribution However, there is one very important difference: The tails of the t-distribution are thicker than those of the normal distribution This difference can be quite pronounced when df is small Patrick Breheny Biostatistical Methods I (BIOS 5710) 23/25

and the sample mean Returning to our test statistic for one-sample inference concerning the mean of a continuous random variable, we have the following result: Suppose X 1, X 2,..., X n N(µ, σ 2 ) are mutually independent; then n X µ S t n 1 In other words, our test statistic from earlier does have a known, well-defined distribution it s just not N(0, 1) Thus, we can still derive hypothesis tests and confidence intervals, we ll just have to use the t-distribution instead of the normal distribution; this will be the subject of the next lecture Patrick Breheny Biostatistical Methods I (BIOS 5710) 24/25

z-tests fail for continuous data because they ignore uncertainty about SD this is especially problematic for small sample sizes Z 1, Z 2,..., Z n N(0, 1) = Z 2 i χ2 n Z N(0, 1), X 2 χ 2 n, and Z X 2 = Z/ X 2 /n t n For X 1, X 2,..., X n N(µ, σ 2 ), n( X µ)/σ N(0, 1) (n 1)S 2 /σ 2 χ 2 n 1 X and S 2 are independent Thus, n( X µ)/s t n 1 Patrick Breheny Biostatistical Methods I (BIOS 5710) 25/25