Hypothesis Testing, Power, Sample Size and Confidence Intervals (Part 2)

Similar documents
Statistics in medicine

Unit 9: Inferences for Proportions and Count Data

Lecture 14: Introduction to Poisson Regression

Modelling counts. Lecture 14: Introduction to Poisson Regression. Overview

Unit 9: Inferences for Proportions and Count Data

Person-Time Data. Incidence. Cumulative Incidence: Example. Cumulative Incidence. Person-Time Data. Person-Time Data

Confidence Intervals, Testing and ANOVA Summary

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F).

Chapter Six: Two Independent Samples Methods 1/51

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F).

Suppose that we are concerned about the effects of smoking. How could we deal with this?

Review. One-way ANOVA, I. What s coming up. Multiple comparisons

PubH 7470: STATISTICS FOR TRANSLATIONAL & CLINICAL RESEARCH

Lecture 3: Measures of effect: Risk Difference Attributable Fraction Risk Ratio and Odds Ratio

PubH 5450 Biostatistics I Prof. Carlin. Lecture 13

Introduction to the Analysis of Tabular Data

Correlation and regression

Question. Hypothesis testing. Example. Answer: hypothesis. Test: true or not? Question. Average is not the mean! μ average. Random deviation or not?

Goodness of Fit Tests

ST3241 Categorical Data Analysis I Two-way Contingency Tables. 2 2 Tables, Relative Risks and Odds Ratios

Section Comparing Two Proportions

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

STAT 705: Analysis of Contingency Tables

HOW TO DETERMINE THE NUMBER OF SUBJECTS NEEDED FOR MY STUDY?

n y π y (1 π) n y +ylogπ +(n y)log(1 π).

Two-sample Categorical data: Testing

Chapter 9. Hypothesis testing. 9.1 Introduction

Tables Table A Table B Table C Table D Table E 675

Sociology 6Z03 Review II

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

Basic Medical Statistics Course

Section IX. Introduction to Logistic Regression for binary outcomes. Poisson regression

An introduction to biostatistics: part 1

ECLT 5810 Linear Regression and Logistic Regression for Classification. Prof. Wai Lam

Binary Logistic Regression

Harvard University. Rigorous Research in Engineering Education

Calculating Effect-Sizes. David B. Wilson, PhD George Mason University

BMI 541/699 Lecture 22

Categorical Data Analysis Chapter 3

Part III: Unstructured Data

Statistical Analysis for QBIC Genetics Adapted by Ellen G. Dow 2017

TA: Sheng Zhgang (Th 1:20) / 342 (W 1:20) / 343 (W 2:25) / 344 (W 12:05) Haoyang Fan (W 1:20) / 346 (Th 12:05) FINAL EXAM

10.4 Hypothesis Testing: Two Independent Samples Proportion

Chapter 8. The analysis of count data. This is page 236 Printer: Opaque this

BIOS 6222: Biostatistics II. Outline. Course Presentation. Course Presentation. Review of Basic Concepts. Why Nonparametrics.

Inferences for Proportions and Count Data

Meta-analysis of epidemiological dose-response studies

Psychology 282 Lecture #4 Outline Inferences in SLR

Introduction to Statistical Analysis

Sample Size Determination

Testing Independence

Comparison of Two Population Means

UNIVERSITY OF MASSACHUSETTS Department of Mathematics and Statistics Applied Statistics Friday, January 15, 2016

Chapter Seven: Multi-Sample Methods 1/52

10: Crosstabs & Independent Proportions

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

Chapter 2: Describing Contingency Tables - I

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

Many natural processes can be fit to a Poisson distribution

Frequency table: Var2 (Spreadsheet1) Count Cumulative Percent Cumulative From To. Percent <x<=

Topic 19 Extensions on the Likelihood Ratio

Stat 642, Lecture notes for 04/12/05 96

Correlation and Simple Linear Regression

Chapter 6. Logistic Regression. 6.1 A linear model for the log odds

Statistics 3858 : Contingency Tables

Tests for Population Proportion(s)

WORKSHOP 3 Measuring Association

Sample Size. Vorasith Sornsrivichai, MD., FETP Epidemiology Unit, Faculty of Medicine Prince of Songkla University

PB HLTH 240A: Advanced Categorical Data Analysis Fall 2007

LISA Short Course Series Generalized Linear Models (GLMs) & Categorical Data Analysis (CDA) in R. Liang (Sally) Shan Nov. 4, 2014

Statistics in medicine

STK4900/ Lecture 3. Program

1 Statistical inference for a population mean

y response variable x 1, x 2,, x k -- a set of explanatory variables

Multinomial Logistic Regression Models

Mathematical Notation Math Introduction to Applied Statistics

Analysis of Categorical Data. Nick Jackson University of Southern California Department of Psychology 10/11/2013

Probability: Why do we care? Lecture 2: Probability and Distributions. Classical Definition. What is Probability?

Problem Set 4 - Solutions

Two Sample Problems. Two sample problems

Chapter 7: Hypothesis testing

Chapter 22. Comparing Two Proportions. Bin Zou STAT 141 University of Alberta Winter / 15

Lecture 7 Time-dependent Covariates in Cox Regression

Chapter Eight: Assessment of Relationships 1/42

Tests for Two Correlated Proportions in a Matched Case- Control Design

Unit 3. Discrete Distributions

Contingency Tables. Contingency tables are used when we want to looking at two (or more) factors. Each factor might have two more or levels.

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

Hypothesis Tests and Estimation for Population Variances. Copyright 2014 Pearson Education, Inc.

STAT 525 Fall Final exam. Tuesday December 14, 2010

REGRESSION ANALYSIS FOR TIME-TO-EVENT DATA THE PROPORTIONAL HAZARDS (COX) MODEL ST520

Introduction to Analysis of Genomic Data Using R Lecture 6: Review Statistics (Part II)

Topic 22 Analysis of Variance

Statistics: revision

Parametric versus Nonparametric Statistics-when to use them and which is more powerful? Dr Mahmoud Alhussami

Comparing p s Dr. Don Edwards notes (slightly edited and augmented) The Odds for Success

INTRODUCTION TO BIOSTATISTICS FOR BIOMEDICAL RESEARCH

The One-Way Repeated-Measures ANOVA. (For Within-Subjects Designs)

STAT 135 Lab 6 Duality of Hypothesis Testing and Confidence Intervals, GLRT, Pearson χ 2 Tests and Q-Q plots. March 8, 2015

Stat 135, Fall 2006 A. Adhikari HOMEWORK 6 SOLUTIONS

Transcription:

Hypothesis Testing, Power, Sample Size and Confidence Intervals (Part 2) B.H. Robbins Scholars Series June 23, 2010 1 / 29

Outline Z-test χ 2 -test Confidence Interval Sample size and power Relative effect measures Summary example 2 / 29

Z-test Overview Compare dichotomous independent variable (predictor) with a dichotomous outcome Independent variables: treatment/control, exposed/not exposed Outcome variables: Diseased/not diseased, Yes/no 3 / 29

Z-test Recall from last time General form of the test statistics (T- or Z-) are QOI constant SE QOI: quantity of interest (Sample average) Constant: A value that is consistent with H 0 (population mean under H 0 ) SE (Standard error): Square root of the variance of the numerator (e.g., uncertainty) under H 0 How big is the signal (numerator) relative to the noise (denominator) 4 / 29

Z-test Normal theory test Two independent samples Sample 1 Sample 2 Sample size n 1 n 2 Population probability of event p 1 p 2 Sample proportion of events ˆp 1 ˆp 2 We want to test H 0 : p 1 = p 2 = p versus H A : p 1 p 2 This is equivalent to testing H 0 : p 1 p 2 = 0 versus H A : p 1 p 2 0 5 / 29

Z-test Normal theory test QOI = ˆp 1 ˆp 2 To obtain the test statistic, we need the variance of ˆp 1 ˆp 2 From last time: Var(ˆp) = ˆp (1 ˆp)/n Note: Variance of a difference is equal to the sum of the variances (if they are uncorrelated) Variance of ˆp 1 ˆp 2 Var(ˆp 1 ˆp 2 ) = ˆp 1(1 ˆp 1 ) n 1 + ˆp 2(1 ˆp 2 ) n 2 but under H 0 (where p 1 = p 2 = p) [ 1 Var(ˆp 1 ˆp 2 ) = p(1 p) + 1 ] n 1 n 2 6 / 29

Z-test Normal theory test Var(ˆp 1 ˆp 2 ) is estimated by using ˆp = n 1ˆp 1 + n 2ˆp 2 n 1 + n 2 which is the pooled estimate of the probability under H 0 : p 1 = p 2 Z-test statistic is given by z = ˆp 1 ˆp 2 [ ] ˆp(1 ˆp) 1 + 1 n1 n2 which has a normal distribution under H 0 if n i ˆp i are large enough We look to see if this z-value is far out in the tails of the standard normal distribution 7 / 29

Z-test Normal theory test: Recall again what we are doing... Under H 0 : p 1 = p 2 1. Draw a sample from the target population 2. Calculate ˆp 1, ˆp 2, ˆp, and then z 3. Save your z value 4. Go back to 1 Repeat again and again. What does this distribution of z values look like? 8 / 29

Z-test Density for the Normal distribution Density 0.0 0.1 0.2 0.3 0.4 4 2 0 2 4 Z value 9 / 29

Z-test Example Do women in the population who are less than 30 at first birth have the same probability of breast cancer as those who are at least 30. Case-control study data With BC Without BC Number of subjects (n 1 and n 2) 3220 10245 Number of subjects 30 683 1498 Sample proportions (ˆp 1 and ˆp 2) 0.212 0.146 10 / 29

Z-test Example Pooled probability: 683 + 1498 3220 + 10245 = 0.162 Calculate variance under H 0 [ 1 Var(ˆp 1 ˆp 2 ) = ˆp(1 ˆp) + 1 ] = 5.54 10 5 n 1 n 2 SE(ˆp 1 ˆp 2 ) = Var(ˆp 1 ˆp 2 ) = 0.00744 Test statistic z = 0.212 0.146 0.00744 Two tailed p-value is effectively 0 = 8.85 11 / 29

χ 2 -test χ 2 test If Z N(0, 1) then Z 2 χ 2 with 1 d.f. (e.g., testing a single difference against 0) The data just discussed can be shown in a two by two table With BC Without BC total Age 30 683 1498 2181 Age < 30 2537 8747 11284 Total 3220 10245 13465 12 / 29

χ 2 -test χ 2 test Two by two table: Disease No disease total Exposed a b a+b Not Exposed c d c+d Total a+c b+d N=a+b+c+d Like the other test statstics, the χ 2 examines the difference between what is observed and what we expected to observe if H 0 is true 2 2 χ 2 (Observed ij Expected ij ) 2 1 = Expected ij i=1 j=1 Observed ij : is the observed frequency in cell (i, j) Expected ij : is the expected cell frequency if H 0 is true. 13 / 29

χ 2 -test χ 2 test Under the null hypothesis, the rows and the columns are independent of one another Having age < 30 or age 30 provides no information about presence/absence of BC Presence / absence of BC provides no information about age Under Independence: Expected ij = Expected 21 = 11284 3220 13465 = 2698.4 Row i total Column j total grand total 14 / 29

χ 2 -test χ 2 test Observed Expected With BC Without BC Age 30 683 1498 Age < 30 2537 8747 With BC Without BC Age 30 522 1659 Age < 30 2698 8586 χ 2 1 = (683 522)2 522 + (1498 1659)2 1659 +... 15 / 29

χ 2 -test χ 2 test For 2 by 2 tables the χ 2 test statistic can also be written In this example, χ 2 1 = 78.37 N(ad bc) 2 (a + c)(b + d)(a + b)(c + d) This χ 2 value is z 2 from earlier. The two sided critical value for the χ 2 1 test is 3.84 Note that even though we re doing a 2-tailed test we only use the right tail in the χ 2 test We ve squared the difference when computing the statistic and so the sign is lost This is called the ordinary Pearson s χ 2 test 16 / 29

χ 2 -test Density for the Normal distribution Density for the Chi square distribution Density 0.0 0.1 0.2 0.3 0.4 Density 0.0 0.5 1.0 1.5 4 2 0 2 4 Z value 0 2 4 6 8 10 Z^2 value 17 / 29

χ 2 -test Critical region for Z test Critical region for χ 1 2 test density 0.0 0.1 0.2 0.3 0.4 4 2 0 2 4 z value Critical region for χ 1 2 test density 0 2 4 6 8 10 density 0.0 0.1 0.2 0.3 0.4 0.5 0 1 2 3 4 5 Chi square value 0 1 2 3 4 5 Chi square value 18 / 29

χ 2 -test Fisher s Exact Test Meant for small sample sizes but is a conservative test (e.g., reject H 0 less often than you could or should) Pearson s χ 2 test work fine often even when expected cell counts are less than 5 (contrary to popular belief) 19 / 29

Confidence Interval Confidence Interval An approximate 1 α two-sided ci is ˆp 1 ˆp 2 ± z 1 α/2 ˆp 1 (1 ˆp 1 ) n 1 + ˆp 2(1 ˆp 2 ) n 2 z 1 α/2 is the critical value for the normal distribution (1.96 when α = 0.05). The confidence limits for the number of patients needed to treat (NNT) to save one event is given by the reciprocal of the two confidence limits. 20 / 29

Confidence Interval Confidence Interval: Physicians Health Study Five-year randomized study of whether regular aspirin intake reduces mortality due to CVD 11037 randomized to receive daily aspirin dose and 11043 randomized to placebo Let s only consider incidence of an MI over the 5 year time frame With MI Without MI total Placebo 198 10845 11043 Aspirin 104 10933 11037 Total 302 21778 22080 21 / 29

Confidence Interval Confidence Interval Example: Physicians Health Study ˆp 1 = 198/11043 = 0.0179 ˆp 2 = 104/11037 = 0.0094 ˆp 1 ˆp 2 = 0.0085 (LCI, UCI ) = (0.0054, 0.0116) 1.79/0.94 percent chance of having an MI in 5 years on placebo/medication The difference (CI) is 0.85 percent (0.54,1.16). Number needed to treat (NNT) to prevent an MI is the inverse of these quantities The interval (86.44, 183.64) contains the NNT to prevent one MI (with 95 percent confidence). 22 / 29

Sample size and power Sample size and power for comparison two proportions Power increases when Sample size (n 1 and n 2 ) increases As n 1 /n 2 1 As = p 1 p 2 increases Power calculation (http://statpages.org/#power) Current therapy: 50% infection-free at 24 hours. New therapy: 70% infection-free Randomly assign n 1 = 100 subjects to receive standard care and n 2 = 100 to receive new therapy. What is the power to detect a significant difference between the two therapies (α = 0.05)? p 1 = 0.5, and p 2 = 0.7, n 1 = n 2 = 100 Power is 0.83. 23 / 29

Sample size and power Sample size and power for comparison two proportions Required sample size decreases when As n1 /n 2 1 As = p1 p 2 increases Required sample size depends on both p 1 and p 2 Example: Number of subjects needed to detect a 20 percent decrease in the probability of colorectal cancer if baseline probability of cancer is 0.15 percent p 1 = 0.0015, p 2 = 0.8 p 1 = 0.0012, α = 0.05, β = 0.2, n 1 = n 2 235145 24 / 29

Relative effect measures Relative effect measures So far, we have discussed absolute risk differences Measures of relative effect include risk ratios and odds ratios RR = p 2 p 1 OR = p 2/(1 p 2 ) p 1 /(1 p 1 ) RRs are easier to interpret than ORs but they have problems (e.g., a risk factor that doubles your risk of lung cancer cannot apply to a subject having a risk of 50 percent) ORs can apply to any subject Testing H 0 : p 1 = p 2 is equivalent to H 0 : OR = 1 There are formulas for computing CIs for odds ratios, although we usually compute CIs for ORs by anti-logging CIs for log ORs based on logistic regression 25 / 29

Summary example Summary Example Consider patients who undergo CABG surgery Study question: Do emergency cases have a surgical mortality rate that is different from that of non-emergent cases. Population probabilities p1 : Probability of death in patients with emergency priority p2 : Probability of death in patients with non-emergency priority Statistical Hypotheses H0 : p 1 = p 2 or H 0 : OR = 1 HA : p 1 p 2 or H 0 : OR 1 26 / 29

Summary example Summary Example: Power Prior Research shows that just over 10 percent of non-emergent surgeries result in death Researcher want to be able to detect a 3-fold increase in risk in death For every 1 emergency priority, we expect 10 non-emergency p 1 = 0.3, p 2 = 0.1, α = 0.05 and power=0.90 Calculate the sample sizes (done using PS software) for these and other combinations of p 1 and p 2 (p 1, p 2 ) (0.3, 0.1) (0.4, 0.2) (0.03, 0.01) (0.9, 0.7) n 1 40 56 589 40 n 2 400 560 5890 400 27 / 29

Summary example Summary Example: Data In hospital mortality for emergency or other surgery ˆp 1 = 6 25 = 0.24 ˆp 2 = 11 111 = 0.10 ˆp 1 ˆp 2 = 0.14 95%CI = ( 0.035, 0.317) p-values: Fisher exact test: 0.087 Pearson χ 2 : 0.054 Outcome Priority Dead alive Emergency 6 19 Other 11 100 28 / 29

Summary example Summary Example: Interpretation Compare the odds of death in the emergency group p 1 1 p 1 versus the other group p 2 1 p 2 OR 1,2 = 0.24 0.76 /0.1 0.9 = 2.87 Emergency cases are estimated to have 2.87 fold increase in odds of death during surgery compared to non-emergency cases with 95%CI : [0.95, 3.36] 29 / 29