Class Notes
(808,147)
Canada
(493,093)
University of Toronto Scarborough
(30,806)
Statistics
(266)
STAB22H3
(208)
Ken Butler
(34)
Lecture
STAB22LEC21(22,23).docx
Unlock Document
University of Toronto Scarborough
Statistics
STAB22H3
Ken Butler
Fall
Description
STAB22, LEC21
CHAPTER 22: MORE ABOUT TESTS
(COVERS 22,23)
[268]
WHAT A HYPOTHESIS TEST IS
 feed into box:
a) data
 sample prop.
b) hypotheses
 hypo. prop.
 SD(phat)
 it splits out PVALUE.  using:
 test statistic (z)
 Normal table
 use this to draw conclusions, remembering to state in context as well
Remember!
 decide on what alpha is BEFORE running hypo test
(ex) if we had set alpha = 0.05, and we got P=0.03, then we reject H0 in favour of HA.
[269]
PUT DOWN ALL THESE FORMULAE ONTO CHEATSHEET
 Up to this point we have done the first two rows
1 Proportion
2 Comparing proportions
 recall:
 H0: no diff in 2 prop's
 HA: diff in 2 prop's
 Now to wrap up the course, we are going to finish off the latter three rows:
 Mean  Comparing means (2 samples)
 Matched pairs
 Procedure is same, but details are diff. (when it comes to hypo testing, CIs,
power, etc.)
 if testing for prop, then H0 will say that p = sth, and that is val to use
 when doing CI, don't have val. of p to use, so that why u use one from SAMPLE
(phat)
 if we had the true prop already, we would not even need to make a
CI!
 Notice that for the means, we need tdistribution and t*, while for prop's,
we need normal distribution and z*.
 Idea of test statistic is same:
[270] CHAPTER 23: INFERENCES ABOUT
MEANS
 use means to make inferences involving quantitative var's (qvar's)
 ex. #calories in serving of yogurt
 for prop's, it is categorical var's (cvar's)
 ex. cause of homocide death
 categories: shooting, poison, stabbing etc.
CLT's statement
 if
a) you sample from popn with mean mu, SD sigma,
b) sample size n is large
 then, sampling distribution of ybar (sample means) approximately
 NORMAL
 has mean mu
 has SD
note: doesn't matter what shape of popn was
Problems satisfying CLT
 sample size may not be sufficiently large
 popn SD almost certainly unknown [271]
INVESTIGATION BY SIMULATION
 Butler set up a simulation on StatCrunch with following characteristics
 popn normal
 mean 30
 sigma 5
 n = 2
 sigma was NOT used though
 sample SD's used instead
Simulated data
 took 1000 samples (n=2)
 mean, SD, z was calculated for each sample
 used mean, SD of sample instead of popn parameters
 calculated Pvalue for each z's sample
 for each Pvalue, it was recorded whether it was...
 Pvalue < alpha
 reject=true
 Pvalue > alpha  reject=false
.. where alpha = 0.05
Problem 1: n too small
 obvious conseq: SD's are vary considerably, some not even close to sigma (=5)
 ex. SD = 10.468317 (sample 4)
 ex. SD = 0.9438873 (sample 11)
Concern #2:
 zvalue, Pvalues vary considerably
 ex. z = 10.361 (sample 10)
 vs. z = 0.250 (sample 14)
 ex. Pvalue = 0.0103 (sample 18)
 vs. Pvalue = 1.284 (sample 11) Problem #2:

 making too many type I errors
 rejected way too many times (283 times, 28.3%)
 ie. see so many trues in the reject col.
 we should have prop. of false rejections be around 0.05
 remember: alpha = probability that we make type I error
[272]
Returning to the pie chart  using sample SD to get zstatistic is wrong when it comes to testing with
means
[273]
PROBLEM(s)! HOW TO FIX THESE UP?
Issue
 sample SD's we are getting aren't, in general, coming close to, let alone being the
same, as popn SD (sigma)
 might be v.far off when n is small
 another key problem (mentioned in text) is that null model for means does
NOT generally follow a normal distribution
 it looks v.like the normal curve by its bellshapedness, but its tail
ends are fatter
 aka tdistribution
 aka Student's t distribution
Solution (by Gosset)  calculate test statistic (t) using sample SD
 then, get Pvalue from table of tdistribution (TABLE T at the back of
textbook) with n1 degrees of freedom
Example:
test:
 H0: mu = 30
 HA: mu ≠ 30 (2sided)
 n = 10
 ybar = 35
 s = 5
then,
= (3530)/(5/\sqrt{10})
= 3.16  Look up in Ttable for the 'df' row 9 (b/c df = 10  1 = 9)
 recall: our 't' = 3.16
 b/ween the cells 2.821 and 3.250 on Ttable
 thus, Pvalue is b/ween 0.01 and 0.02
 remember: we are using 2sided (aka twotailed)
 Butler wanted to be more precise with this Pvalue, so he got the exact Pvalue from
StatCrunch
 2(0.0058) = 0.0116
 but because our alpha = 0.05, it does not matter where in between 0.01 and 0.02 our
Pvalue lies
 reject null anyways, b/c Pvalue < alpha
=> conclusion in context: popn mean NOT 30.
Process of testing using 't' distribution
1. get 't' statistic 2. get 'df' (df = n1)
3. find Pvalue corresponding to this df, 't' statistic
4. make conclusion about hypo, and in context.
[274]
 %type I errors we are likely to make when using tdistribution instead of normal
distribution when getting Pvalues for means is MUCH more closer to 5%
(SATISFACTORY)
 we are comparing this to the other pie chrat, which shows us using normal
distirbution
 remember: we used df = 1, n = 2.
 compare above pie chart to:  making about 4% type I is better than making about 28.4% using zval's and normal
model!
[275]
WHEN WILL tTEST WORK?
 tdistribution theory based on normal popn
 if calc. tstatistic and do entire process to get Pvalue, then will be exactly right
given that popn is normal
large samples small samples
 CLT works, regardless of what is actual  CLT does not work
shape of popn distrib.  possible that sample SD is v.far off from
 sample SD ~ popn SD popn SD
=> does not matter much if we do not  beware of outliers/skewedness
know what sigma is
 large typically
More
Less
Related notes for STAB22H3