Contents Two Sample t Tests Two Sample t Tests

Similar documents
We have also learned that, thanks to the Central Limit Theorem and the Law of Large Numbers,

A string of not-so-obvious statements about correlation in the data. (This refers to the mechanical calculation of correlation in the data.

Data Analysis and Statistical Methods Statistics 651

Statistics for Applications Fall Problem Set 7

ECE 901 Lecture 4: Estimation of Lipschitz smooth functions

Hypothesis tests and confidence intervals

Lecture 10: Bounded Linear Operators and Orthogonality in Hilbert Spaces

Binomial transform of products

Statistics and Data Analysis in MATLAB Kendrick Kay, February 28, Lecture 4: Model fitting

Resampling Methods. X (1/2), i.e., Pr (X i m) = 1/2. We order the data: X (1) X (2) X (n). Define the sample median: ( n.

CS 70 Second Midterm 7 April NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt):

APPLIED MULTIVARIATE ANALYSIS

The Hypergeometric Coupon Collection Problem and its Dual

5.6 Binomial Multi-section Matching Transformer

Common Large/Small Sample Tests 1/55

2 1. The r.s., of size n2, from population 2 will be. 2 and 2. 2) The two populations are independent. This implies that all of the n1 n2

Introduction to Econometrics (3 rd Updated Edition) Solutions to Odd- Numbered End- of- Chapter Exercises: Chapter 3

A PROBABILITY PROBLEM

Lecture 6 Simple alternatives and the Neyman-Pearson lemma

Lecture 2: Monte Carlo Simulation

Recall the study where we estimated the difference between mean systolic blood pressure levels of users of oral contraceptives and non-users, x - y.

Topic 9: Sampling Distributions of Estimators

1 Inferential Methods for Correlation and Regression Analysis

Lecture 19. Curve fitting I. 1 Introduction. 2 Fitting a constant to measured data

Goodness-of-Fit Tests and Categorical Data Analysis (Devore Chapter Fourteen)

Topic 9: Sampling Distributions of Estimators

Topic 9: Sampling Distributions of Estimators

Math 152. Rumbos Fall Solutions to Review Problems for Exam #2. Number of Heads Frequency

Chapter 13: Tests of Hypothesis Section 13.1 Introduction

32 estimating the cumulative distribution function

5.6 Binomial Multi-section Matching Transformer

Topic 18: Composite Hypotheses

The Binomial Multi-Section Transformer

Chapter 22. Comparing Two Proportions. Copyright 2010 Pearson Education, Inc.

(s)h(s) = K( s + 8 ) = 5 and one finite zero is located at z 1

Stat 200 -Testing Summary Page 1

Chapter 2. Asymptotic Notation

GG313 GEOLOGICAL DATA ANALYSIS

Chapter 22. Comparing Two Proportions. Copyright 2010, 2007, 2004 Pearson Education, Inc.

X. Perturbation Theory

Verification of continuous predictands

Sample size calculations. $ available $ per sample

Data Analysis and Statistical Methods Statistics 651

AN EFFICIENT ESTIMATION METHOD FOR THE PARETO DISTRIBUTION

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 19 11/17/2008 LAWS OF LARGE NUMBERS II THE STRONG LAW OF LARGE NUMBERS

t distribution [34] : used to test a mean against an hypothesized value (H 0 : µ = µ 0 ) or the difference

Chapter 5: Hypothesis testing

TMA4245 Statistics. Corrected 30 May and 4 June Norwegian University of Science and Technology Department of Mathematical Sciences.

Power and Type II Error

Module 1 Fundamentals in statistics

COMP 2804 Solutions Assignment 1

Samples from Normal Populations with Known Variances

Lecture 11. Solution of Nonlinear Equations - III

Solutions to Homework 2 - Probability Review

Lecture 7: Properties of Random Samples

Direction: This test is worth 150 points. You are required to complete this test within 55 minutes.

Tests of Hypotheses Based on a Single Sample (Devore Chapter Eight)

Binomial Distribution

6.4 Binomial Coefficients

Interval Estimation (Confidence Interval = C.I.): An interval estimate of some population parameter is an interval of the form (, ),

f(1), and so, if f is continuous, f(x) = f(1)x.

distinct distinct n k n k n! n n k k n 1 if k n, identical identical p j (k) p 0 if k > n n (k)

The standard deviation of the mean

6 Sample Size Calculations

Chapter 23: Inferences About Means

Overview. p 2. Chapter 9. Pooled Estimate of. q = 1 p. Notation for Two Proportions. Inferences about Two Proportions. Assumptions

AVERAGE MARKS SCALING

Properties and Hypothesis Testing

Last Lecture. Wald Test

Comparing Two Populations. Topic 15 - Two Sample Inference I. Comparing Two Means. Comparing Two Pop Means. Background Reading

z is the upper tail critical value from the normal distribution

Sample Size Determination (Two or More Samples)

Some Examples on Gibbs Sampling and Metropolis-Hastings methods

Lecture 3: August 31

Chapter 6 Sampling Distributions

Because it tests for differences between multiple pairs of means in one test, it is called an omnibus test.

Lecture 6 Chi Square Distribution (χ 2 ) and Least Squares Fitting

University of California, Los Angeles Department of Statistics. Hypothesis testing

Direction: This test is worth 250 points. You are required to complete this test within 50 minutes.

MOST PEOPLE WOULD RATHER LIVE WITH A PROBLEM THEY CAN'T SOLVE, THAN ACCEPT A SOLUTION THEY CAN'T UNDERSTAND.

Exam II Review. CEE 3710 November 15, /16/2017. EXAM II Friday, November 17, in class. Open book and open notes.

This is an introductory course in Analysis of Variance and Design of Experiments.

Lecture 6 Chi Square Distribution (χ 2 ) and Least Squares Fitting

Frequentist Inference

Math 4707 Spring 2018 (Darij Grinberg): midterm 2 page 1. Math 4707 Spring 2018 (Darij Grinberg): midterm 2 with solutions [preliminary version]

A quick activity - Central Limit Theorem and Proportions. Lecture 21: Testing Proportions. Results from the GSS. Statistics and the General Population

MidtermII Review. Sta Fall Office Hours Wednesday 12:30-2:30pm Watch linear regression videos before lab on Thursday

Lecture 19: Convergence

Ma/CS 6a Class 22: Power Series

Metrol. Meas. Syst., Vol. XVII (2010), No. 2, pp METROLOGY AND MEASUREMENT SYSTEMS. Index , ISSN

STA Learning Objectives. Population Proportions. Module 10 Comparing Two Proportions. Upon completing this module, you should be able to:

Optimal Estimator for a Sample Set with Response Error. Ed Stanek

6.3 Testing Series With Positive Terms

STAT431 Review. X = n. n )

Bayesian Methods: Introduction to Multi-parameter Models

Linear Regression Demystified

Exercise 4.3 Use the Continuity Theorem to prove the Cramér-Wold Theorem, Theorem. (1) φ a X(1).

Chapter 6 Principles of Data Reduction

ENGI 4421 Confidence Intervals (Two Samples) Page 12-01

TABLES AND FORMULAS FOR MOORE Basic Practice of Statistics

Transcription:

Cotets 3.5.3 Two Saple t Tests................................... 3.5.3 Two Saple t Tests Setup: Two Saples We ow focus o a sceario where we have two idepedet saples fro possibly differet populatios. Our iterest focuses o the differece i populatio eas µ µ y. We assue both saples coe fro oral saplig distributios that ay or ay ot differ i their ea ad variace paraeters. or equivaletly X,..., X Y,..., Y N ( µ, ) N ( µ y, y ) X i = µ + ɛ i, i =,..., ɛ i N ( 0, ) Y j = µ y + δ j, j =,..., δ j N ( 0, y ) I both cases, our theoretical owledge tells us the followig facts: X N ( µ, / ) Ȳ N ( µ y, y/ ), ad () X Ȳ N ( µ µ y, / + y/ ). There are four scearios to hadle, as suarized i the followig table. We will address each sceario i tur, presetig soe theores to justify the proposed tests. We will also eplore the iplicatios i quic eaples. Variace Assuptios Test Distributio Coo variace Variace ow Z test N(0, ) = y = Variace uow t test t + Differet variaces Variaces ow Z test N(0, ) y Variaces uow t test t df. Coo variace, = y =. (a) Variace ow. Coo Variace, Variace Kow Usig the distributio i Eq. () for X Ȳ ad applyig equivalece of variaces, we have statistic Z = ( X Ȳ ) (µ µ y ) N(0, ) + with CI for µ µ y give by Z ± φ + +, rejectio (tail) regio for H 0 : µ µ y = A cosistig of Z with Z > φ +, ad p-value P (Z > z ) for observed value of the test statistic z, coputed i R as (b) Variace uow. R> *por(-abs(z)). ()

Coo Variace, Variace Uow If the variace is uow, we eed to obtai a estiate of. There are actually two estiates available, S ad S y, but uder the assuptio of coo variaces, they both estiate the sae quatity. It would be best if we could cobie these estiates ito a sigle estiator. The pooled variace is such a estiator: S p = ( )S + ( )S y + This estiator weights the estiates obtaied fro each saple by its saple size, which sees logical. There is a theore that gives us a statistic ad saplig distributio for this sceario. Theore 0. Give two saples as i Eq., the statistic T = ( X Ȳ ) (µ µ y ) S p + has a t distributio with + degrees of freedo. t + Proof. We ow, fro Th??, that ( )S χ ad ( )S y χ have chi-squared distributios. I additio, these quatitites are idepedet because the saples are idepedet. Therefore, ( )S + ( )Sy = ( + )S p χ + by the reproductive property of chi-square rado variables. Cosider ad U = X Ȳ (µ µ y ) N(0, ) V = The, Th.?? yields T = U/V t +. + S p = S p. The above-defied t statistic allows us to costruct CI for µ µ y of ( ) + α T ± t + S p + ( where t +α ) ( + is the +α ) th quatile of the t+ distributio coputed as R> qt((+alpha)/, df=+-). The rejectio regios (tails) for H 0 : µ µ y = A iclude values of T where ( ) + α T > t + ad the p-value for reject H 0 : µ = µ y is P (T > t ) for T t + ad the observe statistic t, coputed as R> *pt(-abs(t)). Eaple: Suppose two ethods, A ad B, easure the latet heat of fusio of ice, the chage i heat, easured i calories/gra, whe ice oves fro 0.7 o C to water at 0 o C. Fid the CI for µ A µ B ad test H 0 : µ a = µ B whe X A = 80.0, X B = 79.98, S A = 0.04, S B = 0.03, = 3, ad = 8, assuig the variaces are equal.

The pooled variace is S p = 0.04 + 7 0.03 = 0.000778 The estiated populatio ea differece is X A X B = 0.04 with correspodig saple variace S XA X B = S p 3 + 8 = 0.0. The critical value t 9(0.975) is coputed as R> qt(0.975, df=9) ad is.093. Therefore, the CI are The hypothesis test uses statistic 0.04 ±.093 0.0 = (0.05, 0.065) t = X A X B S XA X B = 0.04 0.0 = 0 3, with p-value give by R> *pt(-0/3, df=9), which is 0.00349. We coclude that at least oe of the two easureet ethods is a biased estiator of the heat of fusio.. Differece variaces, y. (a) Variace ow. Differet Variaces, Variaces Kow Whe variace is ow, we use the ow distributio (Eq. ) of X Ȳ to for statistic with CI for µ µ y give by Z = X Ȳ (µ µ y ) N(0, ) + y X Ȳ ± φ +α + y. Rejectio regios ad p-value are coputed as for the case with coo, ow variace. (b) Variace uow. Differet Variaces, Variaces Uow Whe variace is uow, it is atural to estiate Var( X Ȳ ) =S + S y There is a theore that justifies this choice that we will state without proof. Theore. Give the two-saple setup of Eq., the statistic X Ȳ (µ µ y ) t df S + S y has a t-distributio with degrees of freedo give by df = [( S (S /) ) + ( S y )] + (S y /) 3

Eaple: Returig to the heat of fusio eaple, repeat the aalysis without assuig equal variaces. First, we ust copute df as df = [ ] 0.04 3 + 0.03 8 0.04 0.03 3 8 3 + 8 =.83 We ca roud this to, although R will hadle o-iteger degrees of freedo. The CI becoe ( ) X A X + α 0.04 B ± t.83 + 0.03 = (0.0, 0.068) 3 8 The hypothesis test uses statistic X A X B 0.08 = 3.5 which geerates p-value 0.00895 via R> *pt(-3.5, df=.83). Noral Probability Plot The precedig results deped o startig with two saples of orally distributed rado variables. For o-oral saplig distributios, the CLT gives us the result asyptotically, although saple size ust be large to be sure. Thus, ay data aalysis should start with a eaiatio of the data to assess whether the data are approiately oral. We ow derive oe of the ost coo graphical techiques for assessig orality, the oral probability plot. We etioed it briefly whe coverig graphical suaries of data. Theore. Suppose rado variable X F () has strictly icreasig cdf ad let Z = F (X), the Z Uif(0, ) Proof. P (Z z) = P [F (X) z[ = P [ X F (z) ] = F [ F (z) ] = z The cdf of the stadard oral r.v. is F (z) = z, thus Z Uif(0,). Suppose X F () is the hypothesized cdf (i our case, soe id of oral). Give X,..., X F (), the ordered values, fro sallest to largest, are writte as X (),..., X () where X () is the th sallest value. We clai X () estiates the saple quatile is the first observed value X such that But, ideed, X () does satisfy while X ( ) does ot, so it is the first. #{X i X } #{X i X () } + + + quatile. To verify, reeber the Now F (X i ) are uiforly distributed if ad oly if F () is the true cdf of the X i. I particular, the quatiles X () should ap, via F (X () ), to the quatiles of a Uif(0, ) distributio, aely. Thus, if we plot 4 +

( poits F (X () ), ) +, they should fall alog the lie y = if F () is the saplig distributio of X i. ( )) Equivaletly, we could plot poits (X (), F +, which has the advatage of plottig the data o its origial, presuably iterpretable, scale. Stadardizatio. If we stadardize the data Xi µ first, the F () becoes the stadard oral cdf Φ(). If we do ot use the stadard oral cdf, the we also eed µ ad to copute the cdf F (). I either case, µ ad are( uow, )) but we ca replace the with their saple estiators. Still, we ay prefer to plot (X (), Φ, which requires o owledge of µ or. It agai has the advatage that the -ais is + o the origial data scale. While the data should still for a lie, it is ot the y = idetity lie. There are ay variats of the oral probability plot, but the idea is the sae: Curvature i the poits suggests o-oral data. Eaple: Of Mice ad Iro We ow deostrate how to perfor a two-saple aalysis of data where orality assuptios ay be uder doubt. Suppose ice are give either radioactive F e + or radioactive F e 3+. The, a few days later, their radioactivity is easured i order to deterie which iro suppleet is better retaied by the body. The data is available as Fe.Rtt. Our first cocer is to chec that the data are oral, sice all two-sapled results have assued oral saplig distributios. We ca plot histogras ad see that the data see to be sewed right ad trucated o the left, sice egative radioacitivities are ot possible (Fig. 4). We ca see the oral probability plots (Fig. 4) show soe curvature, so we are cocered about possible o-orality. We ow of oe foral test for distributioal assuptios: the goodess-of-fit. We will bi the data ito the quartiles of a oral distributio. Which oral distributio? We ust estiate its two paraeters with the saple ea ad saple variace. For the F e + data, X = 9.63 ad stadard deviatio S = 6.695. Each paraeter we estiate taes away oe degree of freedo. The quartiles of N(9.6, 6.69 ) are 5.09, 9.6, 4.. We cout the uber of observatios i each iterval. X i < 5.09 5.09 X i < 9.6 9.6 X i < 4. 4. X i Epected Observed 4 9 3 Epected couts are a little low, but we ll proceed with the chi-squared goodess-of-fit test ayway. The statistic is X ( 4 0.5) ( 9 0.5) ( 0.5) ( 3 0.5) = + + + + = 4.7 where we have applied the Yate s cotiuity correctio to each ter. The correctio is ost iportat for low cout data, ad it corrects for the fact that epectatios are cotiuous, but observed data are always discrete. The degrees of freedo are df = 4 =, so the p-value for rejectig the ull hypothesis of orally distributed data is 0.097754. At a traditioal α-level of 0.05, we reject the ull hypothesis, ad develop further worries about usig the t-test. We proceed with the t-test,but do so with great cocer. The saple size = = 8 does ot eceed the rule-of-thub 30 that we lie for trustig CLT asyptotics. The saple stadard deviatios are S = 6.69 ad S 3 = 5.45. We hesitate to assue coo variace, so copute df = 3.79. The t statistic coes to 0.70 ad the p-value is 0.49. Trasforatio. Oe solutio for the o-orality is to trasfor the observed data such that they becoe ore oral-lie. A coo proble is right sew, especially for data that is costraied to live i the positive half of the real lie. To correct right sew, oe ay use the log() or trasforatios, sice both ted to shri large values ad epad sall values. 5

Desity 0.00 0.0 0.04 0.06 0.08 0.0 Desity 0.00 0.0 0.04 0.06 0.08 0.0 0. 0.4 0 5 0 5 0 5 30 Fe (a) F e + 5 0 5 0 Fe3 (b) F e 3+ Stadard Noral Quatiles 0 Stadard Noral Quatiles 0 0 5 0 5 0 5 Fe Estiated Quatiles (c) F e + = o, F e 3+ =.0.5.0.5 3.0 log(fe) Estiated Quatiles (d) log(f e + ) = o, log(f e 3+ ) = Desity 0.0 0. 0.4 0.6 0.8 Desity 0.0 0. 0. 0.3 0.4 0.5 0.6.0.5.0.5 3.0 3.5 log(fe) (e) log(f e + ) 0.5.0.5.0.5 3.0 log(fe3) (f) log(f e 3+ ) Figure 4: Histogras ad Noral Probabililty Plots of Iro Data 6

The result of loggig the iro data is also show i Fig. 4. Much of the o-orality disappears, but soe curvature reais i the oral probability plots. It is liely that further goodess-of-fit tests will ot be sigificat. 7