Z & t-tests - FacStaff Home Page for...

50
Z & t-tests

Transcript of Z & t-tests - FacStaff Home Page for...

Page 1: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Z & t-tests

Page 2: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

• It refers to the statistical tests built on the assumption that the data being analyzed were sampled from a specified distribution

• Parameters of the distribution (e.g. µ & σ2) are estimated and are used to calculate tail probabilities

• Most statistical tests specify the normal distribution

Parametric Analyses

Page 3: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Steps of Parametric Analyses

1. State null and alternative hypotheses

2. Specify the null distribution

3. Obtain sample data

4. Calculate the test statistic & tail probability based on threshold criterion, α

5. Decide to reject or fail to reject the null hypothesis and interpret your decision

Page 4: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Rejecting or Failing to Reject the H0

• If the test statistic falls in the critical region, the null hypothesis is rejected

• If the test statistic does not fall in the critical region, the null hypothesis is NOT rejected

• Notice that no statements are made about the alternative hypothesis

Page 5: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Z-test

• Obtains the probability of sample means being within any interval or beyond any point

• Assumptions: know the population mean and standard deviation and have normally-distributed data

• Thus, we can test simple hypotheses about sample means (called the Z-test) – Calculate z-score for sample mean, zobt

– Compare to critical z-score, zcrit

Page 6: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Who did better on the their test?

Dick Harry

X=70 Y=80

µ=65 µ=70

σ=2 σ=10

Page 7: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Formula for a Z-score

= standard error = standard

deviation of the sampling

distribution

Page 8: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Who did better on the their test?

Dick: (70-65)/(2/(1^0.5)) = 2.5 st. dev.

Harry: (80-70)/(10/(1^0.5)) = 1.0 st. dev.

Page 9: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 10: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 11: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 12: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Use Excel Normsdist function instead

of a unit normal table

Page 13: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

• The probability is 0.773 or 1 - 0.227

Page 14: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Example

– Find the z-score associated with the

upper and lower scores when considering

95% of a normal distribution • “upper and lower scores”: two-tailed test

• α should be divided by 2 before looking up the z-

score

• α/2 = 0.05/2 = 0.025

• ± 2 stdev. ≈ 95% of distribution

Page 15: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 16: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 17: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 18: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

t- distribution

http://www.statsoft.com/textbook/sttable.html#t

Page 19: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 20: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 21: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 22: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

2. Specify the Test Statistic:

t test

21

21

XXs

XXt

21

222

211 11**

21 NNdf

sdfsdfs

TXX

Where this equals the standard error of the

difference between the two means, and df1=n1-1,

df2=n2-1, and dft=n1+n2-2

Page 23: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 24: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 25: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 26: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 27: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 28: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 29: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 30: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 31: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 32: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 33: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 34: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 35: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 36: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 37: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 38: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 39: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 40: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 41: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 42: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Conduct the Correlated t-test

Simulation

• http://onlinestatbook.com/simulations/corre

lated_t/correlated_t.html

Page 43: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 44: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 45: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Generalized Confidence Intervals

P(Y – tα[n-1]sY ≤ µ ≤ Y + tα[n-1]sY) = (1-α)

• where tα[n-1] is the critical value of the t-

distribution with probability P = α, and sample

size n, and sY is the standard error of the mean

• Calculate 95% confidence interval for

previous example with five difference

scores

• 3.04-6.96

Page 46: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

Comparison of Z-test to single

sample t-test H0: µ = 58, HA: µ ≠ 58, α=0.10, n=20, σ2=28, X=56

Z-test

z=(56-58)/((28/20)^0.5) = -1.69 reject H0 because -1.69<-1.645 Zcrit

90% confidence interval = 56±1.645*((28/20)^0.5) = 54.054-57.946

t-test

t=(56-58)/((28/20)^0.5) = -1.69 fail to reject H0 because -1.69>-1.729 tcrit for α=0.10 and df=19

90% confidence interval = 56±1.729*((28/20)^0.5) = 53.955-58.045

Page 47: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 48: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval
Page 49: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval

t-test Equation Summary

• Single sample t = (Y-µH0)/sY

• Dependent sample t-test = (D-µH0)/sD

– where sYorD = sYorD / √n

• Independent sample t-test=((X1-X2)-µH0)/sX1-X2

– where

21

222

211 11**

21 NNdf

sdfsdfs

TXX

Page 50: Z & t-tests - FacStaff Home Page for CBUfacstaff.cbu.edu/~jmoore25/StatisticsLecture/StatsLecture11.pdf · Z-test • Obtains the probability of sample means being within any interval