Power and sample size calculations

Similar documents
Power and sample size calculations

Power and the computation of sample size

Topic 19 Extensions on the Likelihood Ratio

Hypothesis testing. Data to decisions

Power and nonparametric methods Basic statistics for experimental researchersrs 2017

Power and Sample Size Bios 662

Introductory Statistics with R: Simple Inferences for continuous data

EC2001 Econometrics 1 Dr. Jose Olmo Room D309

Two sample Hypothesis tests in R.

Power Analysis. Introduction to Power

Sample Size and Power I: Binary Outcomes. James Ware, PhD Harvard School of Public Health Boston, MA

a Sample By:Dr.Hoseyn Falahzadeh 1

STA Module 10 Comparing Two Proportions

Introductory Econometrics. Review of statistics (Part II: Inference)

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

Power. January 12, 2019

Chapter 5: HYPOTHESIS TESTING

R Short Course Session 4

Hypothesis Testing. Hypothesis: conjecture, proposition or statement based on published literature, data, or a theory that may or may not be true

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

Stat 529 (Winter 2011) Experimental Design for the Two-Sample Problem. Motivation: Designing a new silver coins experiment

Statistical Testing I. De gustibus non est disputandum

Module 17: Two-Sample t-tests, with equal variances for the two populations

How is the Statistical Power of Hypothesis Tests affected by Dose Uncertainty?

Correlation and Simple Linear Regression

Power analysis examples using R

Relax and good luck! STP 231 Example EXAM #2. Instructor: Ela Jackiewicz

Sample Size Calculations

exp{ (x i) 2 i=1 n i=1 (x i a) 2 (x i ) 2 = exp{ i=1 n i=1 n 2ax i a 2 i=1

Welcome! Webinar Biostatistics: sample size & power. Thursday, April 26, 12:30 1:30 pm (NDT)

Lecture 9. ANOVA: Random-effects model, sample size

The problem of base rates

The Purpose of Hypothesis Testing

CH.9 Tests of Hypotheses for a Single Sample

Section 10.1 (Part 2 of 2) Significance Tests: Power of a Test

Sample Size Determination

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

CHAPTER 9, 10. Similar to a courtroom trial. In trying a person for a crime, the jury needs to decide between one of two possibilities:

James H. Steiger. Department of Psychology and Human Development Vanderbilt University. Introduction Factors Influencing Power

Power and sample size calculations

E509A: Principle of Biostatistics. GY Zou

POLI 443 Applied Political Research

Outline The Rank-Sum Test Procedure Paired Data Comparing Two Variances Lab 8: Hypothesis Testing with R. Week 13 Comparing Two Populations, Part II

Importance Sampling and. Radon-Nikodym Derivatives. Steven R. Dunbar. Sampling with respect to 2 distributions. Rare Event Simulation

Chapter Six: Two Independent Samples Methods 1/51

LECTURE 5. Introduction to Econometrics. Hypothesis testing

Philosophy and History of Statistics

Independent Samples t tests. Background for Independent Samples t test

Estimating the accuracy of a hypothesis Setting. Assume a binary classification setting

PRINCIPLE OF MATHEMATICAL INDUCTION

Statistical Inference. Why Use Statistical Inference. Point Estimates. Point Estimates. Greg C Elvers

Two Sample Problems. Two sample problems

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

1 Statistical inference for a population mean

Inference for Single Proportions and Means T.Scofield

Chapter 20 Comparing Groups

Statistical Inference. Hypothesis Testing

Exam 2 (KEY) July 20, 2009

ph: 5.2, 5.6, 5.8, 6.4, 6.5, 6.8, 6.9, 7.2, 7.5 sample mean = sample sd = sample size, n = 9

10.1. Comparing Two Proportions. Section 10.1

Chapter 10: STATISTICAL INFERENCE FOR TWO SAMPLES. Part 1: Hypothesis tests on a µ 1 µ 2 for independent groups

MTMS Mathematical Statistics

Visual interpretation with normal approximation

PHIL12A Section answers, 28 Feb 2011

Harvard University. Rigorous Research in Engineering Education

Inferences About Two Proportions

Chapter 7 Comparison of two independent samples

Confidence Intervals with σ unknown

Statistical inference (estimation, hypothesis tests, confidence intervals) Oct 2018

Sample size and power calculation using R and SAS proc power. Ho Kim GSPH, SNU

Introductory Econometrics

Quantitative Analysis and Empirical Methods

Lecture 5: ANOVA and Correlation

Chapter 9. Inferences from Two Samples. Objective. Notation. Section 9.2. Definition. Notation. q = 1 p. Inferences About Two Proportions

Hypotheses and Errors

Power Analysis. Ben Kite KU CRMDA 2015 Summer Methodology Institute

Gov 2000: 6. Hypothesis Testing

Hypothesis Testing and Confidence Intervals (Part 2): Cohen s d, Logic of Testing, and Confidence Intervals

Announcements. Unit 3: Foundations for inference Lecture 3: Decision errors, significance levels, sample size, and power.

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

Two sided, two sample t-tests. a) IQ = 100 b) Average height for men = c) Average number of white blood cells per cubic millimeter is 7,000.

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

Outline for Today. Review of In-class Exercise Bivariate Hypothesis Test 2: Difference of Means Bivariate Hypothesis Testing 3: Correla

MATH 240. Chapter 8 Outlines of Hypothesis Tests

Soc 3811 Basic Social Statistics Second Midterm Exam Spring Your Name [50 points]: ID #: ANSWERS

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

Comparing Means from Two-Sample

Basics of Experimental Design. Review of Statistics. Basic Study. Experimental Design. When an Experiment is Not Possible. Studying Relations

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

Confidence Intervals and Hypothesis Tests

STAT 135 Lab 5 Bootstrapping and Hypothesis Testing

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

Data Analysis and Statistical Methods Statistics 651

Power and Sample Size + Principles of Simulation. Benjamin Neale March 4 th, 2010 International Twin Workshop, Boulder, CO

(Elementary) Regression Methods & Computational Statistics ( ) Part IV: Hypothesis Testing and Confidence Intervals (cont.)

10: Crosstabs & Independent Proportions

T-tests for 2 Independent Means

T-tests for 2 Independent Means

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

Lecture Slides. Elementary Statistics Eleventh Edition. by Mario F. Triola. and the Triola Statistics Series 9.1-1

Transcription:

Power and sample size calculations Susanne Rosthøj Biostatistisk Afdeling Institut for Folkesundhedsvidenskab Københavns Universitet sr@biostat.ku.dk April 8, 2014

Planning an investigation How many individuals do we need??? It depends on the design the size of the effect we are looking for how certain we want to be in finding the effect and the purpose of the investigation : obtain a specific precision of an estimate obtain a specific (power) of a test (most common). 2 / 12

Precision We want to estimate the risk of CHD for females with a precision of p ± a. 95% confidence interval (95%) : p ± 1.96 p(1 p) Thus a = 1.96 p(1 p) n i.e. n = 3.84p(1 p) a 2. n. We need a guess at p. Example: For p = 0.10 and a = 0.04 we find n = 216. Similarly based on a quantitative outcome n = 3.84( SD a )2 if we need a precision of the mean µ at ±a. 3 / 12

Test of hypotheses A test of a hypothesis H 0 can give two types of error : Type I: Reject the hypothesis even though it is true. Type II: Accept the hypothesis even though it is wrong. Probability of type I error : α = level of significance. Probability of type II error : β. 1 β = power. Truth Conclusion Hypothesis true Hypothesis wrong Accept Correkt conclusion Type II error 1 α β Reject Type I fejl Correkt conclusion α 1 β 4 / 12

Comparison of two groups We determine the number of individuals in each group. Binary response: Determine p 1, p 2, α and β. Let p = 1 2 (p 1 + p 2 ). n = ( z 1 α/2 p1 (1 p 1 ) + p 2 (1 p 2 ) + z 1 β 2 p(1 p) ) 2 (p 1 p 2 ) 2 with z p being the quantiles in the standard normal distribution. Quantitative response: Determine µ 1, µ 2, SD, α an β. We need µ 1 µ 2 (= (delta)). SD 2 n = 2 (µ 1 µ 2 ) 2 (z 1 α/2 + z 1 β ) 2. 5 / 12

The size of the sample The needed samples size depends on : and the level of significance (α) the power (1 β) the difference between the groups : the larger difference the smaller the needed sample size the variation (SD) : the larger, the larger the sample size 6 / 12

Example Assume that we want to detect af difference in SBP of =10mmHg for women randomized to placebo / treatment. We want to be 90% sure to detect the difference (1 β = 0.90) when testing on the 5% significance level (α = 0.05). In the Framingham data we find (SD = 25). I.e. n = 2( SD )2 (z 1 0.05/2 + z 0.90 ) 2 = 2( SD )2 (1.96 + 1.28) 2 We need 132 women in each group. = 2 ( 25 10 )2 10.5 = 131.25. 7 / 12

Sample size calculations in R Comparison of proportions in two groups > power.prop.test( p1=0.6, p2=0.8, power=0.9, sig.level=0.05 ) Two-sample comparison of proportions power calculation n = 108.2355 p1 = 0.6 p2 = 0.8 sig.level = 0.05 power = 0.9 alternative = two.sided NOTE: n is number in *each* group Comparison of means in two groups > power.t.test( delta=10, sd=25, power=0.9, sig.level=0.05 ) Two-sample t test power calculation n = 132.3106 delta = 10 sd = 25 sig.level = 0.05 power = 0.9 alternative = two.sided ## NB : Difference from slide 6 due to rounding of quantiles ## used in formula NOTE: n is number in *each* group More functions for calculating sample size is available in package pwr. 8 / 12

Power calculations If we have two samples of size n = 100 we may ask what the power is to detect a specific difference between the groups. Comparison of proportions in two groups > power.prop.test( p1=0.6, p2=0.8, n=100, sig.level=0.05 ) Two-sample comparison of proportions power calculation n = 100 p1 = 0.6 p2 = 0.8 sig.level = 0.05 power = 0.8757319 alternative = two.sided NOTE: n is number in *each* group Comparison of means in two groups > power.t.test( delta=10, sd=25, n=100, sig.level=0.05 ) Two-sample t test power calculation n = 100 delta = 10 sd = 25 sig.level = 0.05 power = 0.8036466 alternative = two.sided NOTE: n is number in *each* group 9 / 12

Groups of uneaqual size If the group sizes differ we can find the total number of individuals needed by 1) calculate N = 2n as if the groups were of equal size 2) calculate k = n 1 /n 2 describing the difference in group sizes 3) determine the total number of individuals as N total = N (1+k)2 4k. Suppose, in the example above, that we want group 1 to have the double size of group 2 : 1) N = 2 132 = 264 2) k = 2 3) N total = N (1+k)2 4k = 264 9 8 = 297, i.e. n 1 = 198 and n 2 = 99. 10 / 12

Exercise With a power of 90%, a significance level of 5% : Comparing two groups of equal size: 1) How many individuals do we need to detect the difference between proportions of 0.02 and 0.04? How many individuals do we need to detect the difference between proportions of 0.52 and 0.54? 2) How many individuals do we need to detect the difference between means of 2 and 4 (SD = 25)? How many individuals do we need to detect the difference between means of 52 and 54 (SD = 25)? 11 / 12

Additional exercise We will simulate data to illustrate how often Type I an II errors occur. Run each of the two programs below 10 (or 100!) times. Consider the setup with two groups with equal means µ = µ 1 = µ 2 = 100 and SD = 25. Type I error y1 <-rnorm( n=100, mean=100, sd=25 ) y2 <-rnorm( n=100, mean=100, sd=25 ) t.test( y1, y2, var.equal=t ) # Generate sample size of 100 with mean 100, SD=25 # Generate sample size of 100 with mean 100, SD=25 How many times did you reject the (true) null hypothesis (approx 5%). Type II error y1 <-rnorm( n=100, mean=100, sd=25 ) y2 <-rnorm( n=100, mean=110, sd=25 ) t.test( y1, y2, var.equal=t ) # Generate sample size of 100 with mean 100, SD=25 # Generate sample size of 100 with mean 110, SD=25 How many times did you accept the (false) null hypothesis (approx 20%, 1-power found on slide 9). 12 / 12