Chapter 9 Notes

©2008 by S. Gramlich

updated 12/3/2020

 

Hypothesis Testing (for 2 samples)

! = Important Note

! These Notes are not meant to replace Reading.  Read Chapter first.

 

Hypothesis (Significance) Test (HT) = procedure for testing a claim about 2 population parameters

For 2 samples

9-2 z-test for 2 population Proportions P1 & P2

9-3 t-test for 2 population Means μ1 & μ2 (independent samples)

!Part 1 only: Assume Unknown Population Variances/Standard Deviations

9-4 t-test for 2 populations Means μ1 & μ2 (matched pairs)

! we will only focus on 2 tailed tests in this chapter

 

1)  Identify Hypotheses:

            H0 =  Null Hypothesis, always contains equals, nothing happening

            for z-test:                                 H0:  P1 = P2  --> P1 - P2 = 0

for t-test (independent):          H0:  μ1 = μ2  --> μ1 - μ2 = 0

for t-test (matched):                H0:  μ1 = μ2  --> μ1 - μ2 = 0 --> μd = 0

            H1 =  Alternative Hypothesis, does not contain equals, something happening

            for z-test:                                 H1:  P1 ≠ P2  --> P1 - P2 ≠ 0

            for t-test (independent):          H1:  μ1 ≠ μ2  --> μ1 - μ2 ≠ 0

for t-test (matched):                H1:  μ1 ≠ μ2  --> μ1 - μ2 ≠ 0 --> μd ≠ 0

 

2)  Write given (alpha, n, sample stats) and check Assumptions

alpha α = significance level = area of critical region shaded in 2 tails

! since Alternative Hypothesis is not equal to (≠) then 2 tailed test (α/2)

            sample stats:

            for z-test:  2 sample proportions of successes (phat1 & phat2)

for t-test (independent):  2 sample means (xbar1 & xbar2) and 2 sample standard deviation (s1 & s2)

for t-test (matched):  1 sample difference mean (dbar) and 1 sample difference standard deviation (sd)

 

Assumptions (for each sample):

for z-test:  Binomial (2 outcomes: "Success" and "Failure"), Normality [x & (n-x) >=5], SRS

for t-tests:  observations unrelated (Independent) or related (Dependent or Matched), Normal or n >30, SRS, σ1 & σ2 unknown

 

3)  find critical value (cv) = cutoff value for the critical region

            for z-test:  find zα/2 from Table A-2 NEGATIVE z Scores

            for t-test (indep):  find tα/2 in Table A-3 (use smaller df)

            for t-test (matched):  find tα/2 in Table A-3 (df= #pairs - 1)

 

4)  calculate test statistic (ts) = convert sample stat to z or t score

            for z-test:  z = [(phat1 -phat2) - (P1 - P2)] / [√(pbar*qbar/n1 + pbar*qbar/n2)]

                                    where pbar = (x1+x2) / (n1+n2), qbar = 1 - pbar

            ! for P1 - P2 use 0

for t-test(indep):  t = [(xbar1 - xbar2) - (μ1 - μ2)] / √[ s12/n1 + s22/n2]

            ! for μ1 - μ2 use 0

            for t-test, t = (dbar - μd) / (sd/√n)

            ! for μd use 0

 

5)  Draw bell curve & shade critical region.

            for z-test:  label hypothesized P1 - P2 & mean z = 0 in middle, cv & ts

            for t-test (indep):  label hypothesized μ1 - μ2 & mean t = 0 in middle, cv & ts

            for t-test (matched):  label hypothesized μd & mean t = 0 in middle, cv & ts

 

6)  Traditional Method Decision Rule (DR)

            if ts is visually inside critical region, reject null.

            if ts is visually outside critical region, fail to reject null.

 

7)  find P-value = area under curve corresponding to test statistic

            for z-test:  find ts z score and corresponding P-val from body of table; double this value for a 2 tailed test

            for t-tests:  find closest range of values for ts t score in body of table, P-val will be range of values in top row (2-tail)

 

8)  P-Value Method DR

            if p-val <= alpha, reject null.

            if p-val > alpha, fail to reject null.

 

9)  Calculate Confidence Interval (CI)

            for z-test:                     (phat1 -phat2) - E < P1 - P2 < (phat1 -phat2) + E

where E = zα/2 * √(phat1*qhat1/n1 + phat2*qhat2/n2)]

            for t-test (indep):         (xbar1 - xbar2) - E < μ1 - μ2 < (xbar1 - xbar2) + E

                                                            where E = tα/2 * √[ s12/n1 + s22/n2]

            for t-test (matched):    dbar - E < μd < dbar+ E

                                                            E = tα/2 * sd /√n

 

10)  CI DR

            if CI does NOT contain zero, reject.

            if CI contains zero, fail to reject.

 

11)  State conclusion in words relative to the original claim.

 

 

TECHNOLOGY

using StatCrunch calculators:

! Don't need to enter any info in StatCrunch spreadsheet for critical value procedures

to find cv zc:   Stat - Calculators - Normal - (enter α or α/2 in last box) - Compute

to find cv tc:   Stat - Calculators - T - (df=n-1 in 1st box, enter α or α/2 in last box) - Compute

! 3rd box will give critical value in both above procedures

 

to find z P-value:  Stat - Calculators - Normal - (enter ts in 3rd box) - Compute

to find t P-value:  Stat - Calculators - T - (df=n-1 in 1st box, enter ts in 2nd box) - Compute

! in both procedures above, double the value to get P-val for a 2 tailed test

! StatCrunch HT procedures below don't give the cv

 

using StatCrunch procedures:

! StatCrunch HT procedures below don't give the cv

for 2 sample P z-test HT:

! Don't need to enter any info in StatCrunch spreadsheet for this procedure

Stat - Proportions - Two sample - with summary - (enter # successes, # observations for each sample) - Next -

-Hypothesis Test - (enter null & alternative) - Calculate

 

for 2 sample P z-CI:

! Don't need to enter any info in StatCrunch spreadsheet for this procedure

Stat - Proportions - Two sample - with summary - (enter # successes, # observations for each sample) - Next -

- Confidence Interval - (enter CL for Level) - Calculate

 

for μ t-test (indep) HT:

! This procedure can be used with summary or original data set

Stat - T statistics - Two Sample - (select column) - Next -

- Hypothesis Test - (enter null & alternative) - Calculate

 

for μ t-test (indep) CI:

! This procedure can be used with summary or original data set

Stat - T statistics - Two Sample - (select column) - Next -

- Confidence Interval - (enter CL for Level) - Calculate

 

for μ t-test (matched pair) HT:

! this procedure can only be done if you have the original data set (not the summary),

entered into a column of the StatCrunch spreadsheet first

Stat - T statistics - Paired - (select column) - Next -

- Hypothesis Test - (enter null & alternative) - Calculate

 

for μ t-test (matched pair) CI:

! this procedure can only be done if you have the original data set (not the summary),

entered into a column of the StatCrunch spreadsheet first

Stat - T statistics - Paired - (select column) - Next -

- Confidence Interval - (enter CL for Level) - Calculate

 

EXCEL commands:

! enter the given value inside the parentheses

! Excel "Dist" commands will only give area to the Left of z or x

Find                 Excel Command

cv zc                 =NormSinv(α/2) {! will only give the negative critical z value}

cv tc                 =tinv(α,df)   {! will only give the positive critical t value; enter α and not α/2}

z P-value         =NormSdist(ts) {! enter ts as negative and double for 2tail}

t P-value         =tDist(ts, df, tails) {! can't enter ts as a negative value}

 

The "Using Technology" section in the text gives Excel procedures using DDXL.

The DDXL add-in can be found in CourseCompass under Chapter Contents (in left margin) - Tools for Success -DDXL.

! DDXL must be downloaded from CourseCompass and then added into the Excel software. If you are using a college computer, the add-in will be removed when the computer is reset.

! In Excel 2007, you have to highlight the data before launching into a DDXL procedure.

 

EXCEL Data Analysis Procedures for t-tests {! there is no procedure the z-test}

! This procedure can only be done if you have the ORIGINAL data set

! The Data Analysis add-in must be added in first

(indep) Tools - Data Analysis - t-test:Two-Sample Assuming Unequal Variances - ok - (highlight & enter data) - ok

(match) Tools - Data Analysis - t-test:Paired Two Sample for Means - ok - (highlight & enter data) - ok

! Excel 2007 the Data Analysis procedures are found the Data menu not the Tools menu