Lecture 17. Ingo Ruczinski. October 26, Department of Biostatistics Johns Hopkins Bloomberg School of Public Health Johns Hopkins University

Similar documents
Lecture 30. DATA 8 Summer Regression Inference

1 Hypothesis testing for a single mean

Unit 6 - Introduction to linear regression

AMS 7 Correlation and Regression Lecture 8

The t-test: A z-score for a sample mean tells us where in the distribution the particular mean lies

Area1 Scaled Score (NAPLEX) .535 ** **.000 N. Sig. (2-tailed)

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

One-Sample and Two-Sample Means Tests

Answer Key. 9.1 Scatter Plots and Linear Correlation. Chapter 9 Regression and Correlation. CK-12 Advanced Probability and Statistics Concepts 1

Unit 6 - Simple linear regression

Objectives Simple linear regression. Statistical model for linear regression. Estimating the regression parameters

Chapter 7 Comparison of two independent samples

Review 6. n 1 = 85 n 2 = 75 x 1 = x 2 = s 1 = 38.7 s 2 = 39.2

Chapter 16: Understanding Relationships Numerical Data

ST430 Exam 1 with Answers

Business Analytics and Data Mining Modeling Using R Prof. Gaurav Dixit Department of Management Studies Indian Institute of Technology, Roorkee

What is a Hypothesis?

Unit 12: Analysis of Single Factor Experiments

Chapter 12 - Lecture 2 Inferences about regression coefficient

Mathematics for Economics MA course

INTERVAL ESTIMATION AND HYPOTHESES TESTING

11 Correlation and Regression

Midterm 1 and 2 results

Inference for Regression

(ii) Scan your answer sheets INTO ONE FILE only, and submit it in the drop-box.

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

BIO5312 Biostatistics Lecture 6: Statistical hypothesis testings

This document contains 3 sets of practice problems.

CIVL /8904 T R A F F I C F L O W T H E O R Y L E C T U R E - 8

This is a multiple choice and short answer practice exam. It does not count towards your grade. You may use the tables in your book.

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL - MAY 2005 EXAMINATIONS STA 248 H1S. Duration - 3 hours. Aids Allowed: Calculator

Correlation Analysis

LECTURE 6. Introduction to Econometrics. Hypothesis testing & Goodness of fit

Stat 427/527: Advanced Data Analysis I

Review: General Approach to Hypothesis Testing. 1. Define the research question and formulate the appropriate null and alternative hypotheses.

CBA4 is live in practice mode this week exam mode from Saturday!

Black White Total Observed Expected χ 2 = (f observed f expected ) 2 f expected (83 126) 2 ( )2 126

Outline. PubH 5450 Biostatistics I Prof. Carlin. Confidence Interval for the Mean. Part I. Reviews

Lecture 5: ANOVA and Correlation

Lectures on Simple Linear Regression Stat 431, Summer 2012

Correlation and Regression

Non-parametric (Distribution-free) approaches p188 CN

Lecture 10: F -Tests, ANOVA and R 2

Simple linear regression

Two-sample inference: Continuous data

Chapter 2: Tools for Exploring Univariate Data

STA Module 11 Inferences for Two Population Means

STA Rev. F Learning Objectives. Two Population Means. Module 11 Inferences for Two Population Means

Review of Statistics 101

Midterm 2 - Solutions

Inferences for Correlation

STAT 135 Lab 5 Bootstrapping and Hypothesis Testing

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

T-tests for 2 Independent Means

T-tests for 2 Independent Means

Business Statistics. Lecture 10: Course Review

Math 1710 Class 20. V2u. Last Time. Graphs and Association. Correlation. Regression. Association, Correlation, Regression Dr. Back. Oct.

Keppel, G. & Wickens, T.D. Design and Analysis Chapter 2: Sources of Variability and Sums of Squares

Harvard University. Rigorous Research in Engineering Education

Dover- Sherborn High School Mathematics Curriculum Probability and Statistics

You have 3 hours to complete the exam. Some questions are harder than others, so don t spend too long on any one question.

An inferential procedure to use sample data to understand a population Procedures

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

16.400/453J Human Factors Engineering. Design of Experiments II

Comparing Means from Two-Sample

One-sample categorical data: approximate inference

ANOVA TESTING 4STEPS. 1. State the hypothesis. : H 0 : µ 1 =

ECN221 Exam 1 VERSION B Fall 2017 (Modules 1-4), ASU-COX VERSION B

Data files & analysis PrsnLee.out Ch9.xls

CORRELATION. suppose you get r 0. Does that mean there is no correlation between the data sets? many aspects of the data may a ect the value of r

Statistics and Quantitative Analysis U4320

Review for Final. Chapter 1 Type of studies: anecdotal, observational, experimental Random sampling

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

Inferences for Regression

Chapter 7. Practice Exam Questions and Solutions for Final Exam, Spring 2009 Statistics 301, Professor Wardrop

ECON 497 Midterm Spring

Descriptive Statistics-I. Dr Mahmoud Alhussami

1 Introduction to One-way ANOVA

Statistics: CI, Tolerance Intervals, Exceedance, and Hypothesis Testing. Confidence intervals on mean. CL = x ± t * CL1- = exp

Stats Review Chapter 14. Mary Stangler Center for Academic Success Revised 8/16

ANOVA Situation The F Statistic Multiple Comparisons. 1-Way ANOVA MATH 143. Department of Mathematics and Statistics Calvin College

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

STAT5044: Regression and Anova. Inyoung Kim

Hypothesis testing. Data to decisions

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

1 Statistical inference for a population mean

Two-sample inference: Continuous data

Statistics Primer. ORC Staff: Jayme Palka Peter Boedeker Marcus Fagan Trey Dejong

Sociology 6Z03 Review II

Simple Linear Regression for the Climate Data

Business Statistics Midterm Exam Fall 2015 Russell. Please sign here to acknowledge

Ecn Analysis of Economic Data University of California - Davis February 23, 2010 Instructor: John Parman. Midterm 2. Name: ID Number: Section:

Analysis of Variance: Part 1

Rejection regions for the bivariate case

ST505/S697R: Fall Homework 2 Solution.

9. Linear Regression and Correlation

Difference between means - t-test /25

Weldon s dice. Lecture 15 - χ 2 Tests. Labby s dice. Labby s dice (cont.)

Lecture 14. Analysis of Variance * Correlation and Regression. The McGraw-Hill Companies, Inc., 2000

Lecture 14. Outline. Outline. Analysis of Variance * Correlation and Regression Analysis of Variance (ANOVA)

Transcription:

Lecture 17 Department of Biostatistics Johns Hopkins Bloomberg School of Public Health Johns Hopkins University October 26, 2015

1 2 3 4 5

1 Paired difference hypothesis tests 2 Independent group differences hypothesis tests

Hypothesis testing for comparing two means When comparing, first determine whether observations are paired or not When dealing a single set of paired data, one strategy is to take the difference between the paired observation and do a one-sample t test of H 0 : µ d = 0 versus H a : µ d 0 (or one of the other two alternatives) Test statistic is X d µ d0 S d / n d where µ d0 is the value under the null hypothesis (typically 0); compare this statistic to a t nd 1 or z statistic

Example Consider Exam 1 and Exam 2 grades from a previous class Is there any evidence that the second exam was easier or harder than the first? The same students took both exams with none dropping out in-between Summaries for the two exams > summary(test1) Min. 1st Qu. Median Mean 3rd Qu. Max. 76.19 82.86 86.67 86.94 91.43 100.00 > summary(test2) Min. 1st Qu. Median Mean 3rd Qu. Max. 71.00 87.00 90.00 89.82 93.00 100.00

Test 2 70 75 80 85 90 95 100 Cor = 0.21 SD1 = 6.07 SD2 = 6.06 70 75 80 85 90 95 100 Test 1

Test 2 Test 1 20 10 0 10 80 85 90 95 (Test 1 + Test 2) / 2

R Code diff <- test2 - test1 n <- sum(!is.na(diff)) #49 mean(diff) #2.88 sd(diff) #7.61 teststat <- sqrt(n) * mean(diff) / sd(diff) #2.65 # below works out to be 0.01 2 * pt(abs(teststat), n -1, lower.tail = FALSE) ##uses the R function t.test(diff)

Discussion of matched data Also to consider, are ratios more relevant than pair-wise differences? ; if so, try doing the test on the log-observations When considering matched pairs data, you often want to plot the first observation by the second A more efficient plot displays the average of the observations by the difference or doing this on the log scale The previous plot is called a mean/difference plot, invented by Tukey (sometimes it is called a Bland/Altman plot after researchers who effectively described and used the method for considering measurement error)

Regression to mediocrity Francis Galton was the first to recognize that for matched data, high initial observations tended to be associated with lower second observations and low initial observations tended to be associated with higher second observations Example: Sons of very tall fathers tend to be a little shorter (also fathers of very tall sons tend to be shorter) Example: Second exams for those who scored very high on a first exam tend to be a little lower

Test 2 70 75 80 85 90 95 100 Cor = 0.21 SD1 = 6.07 SD2 = 6.06 Of the 8 people who got below an 80 on Test 1, all did better on Test 2. Identity line Of the 5 people above 95 on Test 1, 3 did worse on the second test. 70 75 80 85 90 95 100 Test 1

RTM continued To investigate more, we normalize both scales (so that their means are both 0 and standard deviations 1) If there was no, the data would scatter about an identity line The best fitting line goes through the average and has slope Cor(Test1, Test2) SD(Test2) SD(Test1) and passes through the point. {mean(test1), mean(test2)} Because we normalized the data, our line passes through (0, 0) and has slope Cor(Test1, Test2) (normalizing doesn t impact the correlation)

RTM continued The best fitting regression line has slope Cor(Test1, Test2) < 1 This will be shrunk toward a horizontal line, telling us our expected normalized test score for Test 2 will be Cor(Test1, Test2) times the normalized Test 1 score This line appropriately adjusts for for Test 2 conditioning on Test 1; we could similarly do the same for Test 1 conditioning on Test 2; this line will have slope Cor(Test1, Test2) 1 if plot with Test 1 on the horizontal axis The latter line will be shrunk toward a vertical line; the identity line will fall between the two

Normalized Test 2 3 2 1 0 1 2 Regression line of Test 1 on Test 2 Identity line Regression line of Test 2 on Test 1 3 2 1 0 1 2 Normalized Test 1

Final comments An ideal examiner would have little difference between the identity line and the fitted regression line The more unrelated the two exam scores are, the more pronounced the If you watch sports you have to wonder how much discussion is over Athletes who perform the best will often perform worse the next year; is this or an actual decline in the athlete s ability?

The extension to two should come as no surprise H 0 : µ 1 = µ 2, versus H a : µ 1 µ 2 (or one of the other two alternatives) Assuming a comon error variance we have X Ȳ S p 1 n x + 1 n y which will follow a t nx +n y 2 distribution under the null hypothesis and the usual assumptions

Continued If the assuming a common error variance is questionable X Ȳ S 2 x n x + S2 y n y follows a standard normal distribution for large n x and n y. It follows an approximate Students T distribution if the X i and Y i are normally distributed The approximate degrees of freedom are (S 2 x /n x + S 2 y /n y ) 2 (S 2 x /n x ) 2 /(n x 1) + (S 2 y /n y ) 2 /(n y 1)

Note the connection between hypothesis testing and confidence intervals still holds; for example, if zero is in your group T interval, you will fail to reject the group T test for equal means Don t test for equality of means by comparing separately constructed intervals for the two and rejecting the null hypothesis if they do not overlap This procedure has lower power than just doing the right test Also, it leads to the potential abuse of comparing intervals for paired data

Example Suppose that instead of having repeated data on two consecutive exams, students were randomized to two teaching modules and took the same exam We might obtain data like the following Group N Mean Exam SD Exam Module 1 50 86.9 6.07 Module 2 50 89.8 6.06 Pooled standard deviation 6.065 1 Test stat (you do the rest) 89.8 86.9 6.065 1 50 + 1 50 1 note this is not obtained by averaging the two standard deviations, it s obtained by averaging the variances then square rooting

Look over the review notes on formal tests for equality of variances between two These tests, employing the F distribution, rely heavily on normality assumptions Alternatively, for moderate sample sizes, consider creating a bootstrap confidence interval for the ratio of the two variances For smaller sample sizes, consider basing decisions on exploratory data analysis

Final comments Suppose you have equal numbers of observations for two (say X and Y ) If the data are truly matched, then the standard error of the difference is estimating σy 2 n + σ2 x n 2Cov(X, Y ) n If you ignore the matching, then the standard error of the difference is estimating σy 2 n + σ2 x n Since, generally, matched data is positively correlated, by ignoring the matching you are likely (violating assumptions and) inflating your standard error unnecessarily