Upload
einstein2d
View
213
Download
0
Embed Size (px)
Citation preview
8/19/2019 4.T-Test
1/68
Hypotheses TestingHypotheses Testing
Deng Dan
The Department of Medical Statistics
8/19/2019 4.T-Test
2/68
Definition of Hypotheses TestingDefinition of Hypotheses Testing
Hypotheses tests are procedures formaking rational decisions about the
reality of effects.
It is made based on probabilitytheorem.
8/19/2019 4.T-Test
3/68
An example for introductionAn example for introduction
An research office is interested in checking onwhether beginning 5 th graders in their districtscore at the national norm le!el "5.#$ in spelling%a subset of the language Arts standardi&ed test.
A random sample of n'5# cases is drawn fromthe population of all beginning 5 th gradestudents in the Mesa School District.
In the sample of 5# students% the mean is (.)*and the standard de!iation is +.+5.
8/19/2019 4.T-Test
4/68
Question exists…Question exists…
Information from the sample,
n'5# mean '(.)* SD'+.+5
And we know the mean of population is 5.#
So there is difference between the samplestatistic and population parameter.
8/19/2019 4.T-Test
5/68
Cont…Cont…
The difference compared to sample mean of (.)*and population mean of 5.# is 5.# - (.)*'#.* % butwe know that if we were to take another samplethe difference would not be e/actly the same.
It might be greater% it might be smaller.
0hat kind of population difference is consistentwith this obser!ed !alue of (.)*1
8/19/2019 4.T-Test
6/68
The source of the differenceThe source of the difference
Sampling error This study was sampling and we got the samplewas randomly from the population we known.
2emember that the sampling distribution is
known and the probability to get the 3uantity oferror can be estimated.
True difference The difference really e/ists because the sample
drawn from another different population whichparameter is not what we known.
That is the two population differs.
8/19/2019 4.T-Test
7/68
The way we may thinking…The way we may thinking…
4aturally we assume this sample we gotdrawn from the population that we knownwhich parameter was 5.#.
As a sample drawn from a population and itrepresents the population% so we can use the
information from the sample to illustrated thepopulation characteristics.
8/19/2019 4.T-Test
8/68
And more…And more…
0e also think% from the population we got theparticular sample which differed #.* from thepopulation by only ust one sampling% ob!iouslywe generated the 3uantity of the error in this
manner was 3uiet easy.
Thus it was not rarely occasional we got theerror. The probability gained the sample mustbe not little.
8/19/2019 4.T-Test
9/68
Cont…Cont…If we computed out the probability gained the
sample we will make a rational decisions basedon probability theory.
If the probability is not small we belie!e thesampling error is not rare. 6rom thispopulation to get this sample is reasonable.
7therwise if the probability !alue is !ery smallwe belie!e the sampling error is rare% and weha!e to doubt that this sample which cause thesampling error can draw from the population1
8/19/2019 4.T-Test
10/68
8/19/2019 4.T-Test
11/68
Cont…Cont…In this manner of sampling we can gain thesample8s probability by using samplingdistribution theory.
The standard error of the mean is known or thesample si&e is large enough.
The standard error of the mean is estimated.
x
xu
σ
µ 0−=
xS
xt 0 µ
−
=
8/19/2019 4.T-Test
12/68
Cont…Cont…
6rom the u transformation formula we can getthe u !alue,
'"(.)* 5.#$9"+.+59).#)$' +.#:
And from the gained u !alue we can check the u
table to find the probability " p !alue$.
The p !alue is #.* : .
x
xu
σ
µ 0−=
8/19/2019 4.T-Test
13/68
Cont…Cont…In order to determine the sample is whether easyto be drawn we firstly prescribe a special p !alue%which is commonly #.#5.
If the e!ent8s probability !alues is less than thespecial !alue% we can conclude that this samplingerror or e/treme is impossible to be drawn in ustone sampling.
So we compare the p !alue of them.
This is the application of
the rule of the the small probability e!ent .
8/19/2019 4.T-Test
14/68
e!iew…e!iew…
The small probability !alue Habitually% we define ;"A$ #.#5 as small
probability !alue.
The small probability e!ent If random e!ent A occurrences less than 5 times in+## times repeated obser!ations% we usually named therandom e!ent A as the small probability e!ent.
The rule of the small probability e!entIf random e!ent A is defined as small probability
e!ent% we can consider that the random e!ent A wouldoccur impossibly at one randomi&ed obser!ation.
8/19/2019 4.T-Test
15/68
"teps of hypotheses testing"teps of hypotheses testing
Setting up testing hypotheses and le!el ofsignificance
Selecting suitable method and computingrele!ant statistic
8/19/2019 4.T-Test
16/68
The first step of hypotheses testing
It is to specify the null hypothesis "H#$ andthe alternati!e hypothesis "H +$
Typically the #.#5 or the #.#+ le!el is used. It isthe small probability !alue. The probability!alue computed in step = is compared with the
significance le!el chosen in this step.
7ne tail or two tail test depending on yourprofessional knowledge.
8/19/2019 4.T-Test
17/68
It is the second step.
0e calculate a statistic analogous to theparameter specified by the null hypothesis.
The calculation are made assuming that thenull hypothesis is true.
>sually we use the statistic8s name to name theapplied methods.
8/19/2019 4.T-Test
18/68
It is the third step.
0e calculate the probability !alue% which oftencalled as the p !alue.
The probability of obtaining a statistic asdifferent or more different from the parameterspecified in the null hypothesis as the statistic
computed from the data.
The calculation are made assuming that the nullhypothesis is true.
8/19/2019 4.T-Test
19/68
8/19/2019 4.T-Test
20/68
If the probability is less than or e3ual to the
significance le!el% then the null hypothesis isre ected.
0hen H# is re ected% the outcome is said to be?statistically significant@.
If the probability is greater than the significancele!el% then the null hypothesis is not re ected.
0hen H# is not re ected% then the outcome is saidto be ?not statistically significant@.
8/19/2019 4.T-Test
21/68
If the outcome is statistically significant% then
the null hypothesis is re ected in fa!or of thealternati!e hypothesis.
The final step is to describe the result and thestatistical conclusion in an understandable way.
;lease pay attention to the phenomena,
There is the two kind of the error occurredduring hypothesis testing process because of theprobability inference.
8/19/2019 4.T-Test
22/68
Definition, The approach is to set up anassumption that there is no contraction between
the belie!ed result and the sample result and thatthe difference therefore can be ascribed solely tochance.
It is the null hypotheses that is actually tested% notthe research hypotheses.
If the research concerns whether one method of presentingpictorial stimuli leads to better recognition than another.The null hypotheses would most likely be that there is nodifference between methods.
H #, + *'# or + ' *
8/19/2019 4.T-Test
23/68
Definition, If the null hypothesis is re ected% thatis taken as e!idence in fa!or of the research
hypothesis which is called as the alternati!ehypothesis.
In usual practice we do not say that the researchhypothesis has been ?pro!ed@ only that it hasbeen supported.
If the research concerns whether one method ofpresenting pictorial stimuli leads to better recognitionthan another. The alternati!e hypothesis would be,
H +, + *
8/19/2019 4.T-Test
24/68
Hypothesis testing implies that a difference that
a statistic would differ as much or more fromparameter in either direction would be counted.
A probability computed considering differencesin both directions is called a ?two tailed@probability% otherwise it is a ?one tailed@ test.
;robability !alues for one tailed tests arealways one half the !alue for two tailed tests aslong as the effect is in the specified direction.
8/19/2019 4.T-Test
25/68
Type error and type errorⅠ Ⅱ
8/19/2019 4.T-Test
26/68
Type errorⅠ
A true null hypothesis can be incorrectly re ected.
The probability of a type error isⅠ B% thesignificance le!el. It is directly controlled by the
researchers.
type errorⅡ
A false null hypothesis can fail to be re ected. The probability of a type error isⅡ C% but this
!alue is not directly set by the researchers.
8/19/2019 4.T-Test
27/68
Cont…Cont…
Statisticaldecision
True state of nullhypothesis
H # true H # false
2e ect H # Type errorⅠ
8/19/2019 4.T-Test
28/68
Cont…Cont…
The !alue of C is in!ersely related to the !alueof B. 6or e/ample, The smaller the !alue of B %the larger the !alue of C.
In order to minimi&e the two type error at thesame time% we ha!e to enlarge the sample si&e n.
It is the best way.
8/19/2019 4.T-Test
29/68
t#testt#test
8/19/2019 4.T-Test
30/68
The purpose…The purpose…To test whether the sample8s population is thesame population which parameter is known.
If the testing is for two independent samples the
hypothesis is to test whether parameters of twopopulation which samples drawn from aree3ual.
If we use it for paired design data test% it testthe parameters of two population whichsamples drawn from are e3ual.
8/19/2019 4.T-Test
31/68
$eneral formula$eneral formulaThe formula shown below is used for testinghypotheses about a parameter,
The ?statistic@ is an estimation of the parameter in3uestion.
The ?hypothesi&ed !alue@ is the !alue of theparameter specified in the null hypothesis.
The standard error of the statistic is assumed to beknown and the sampling distribution of the statisticis assumed to normal. 7r n is large enough.
u 'statistic - hypothesi&ed !alue
the standard error of the statistic
8/19/2019 4.T-Test
32/68
Cont…Cont…
0hen / is estimated by s / % the significance testuses the t distribution instead of the normaldistribution.
That is standard error of statistic is estimatedalso.
statistic - hypothesi&ed !alue
the standard error of the statistict '
8/19/2019 4.T-Test
33/68
Common types of t#testCommon types of t#test
u tests of % known
t tests of % standard de!iation estimated
t tests of differences between means% dependentmeans by related paired design
t tests of differences between means% independentmeans by random design
8/19/2019 4.T-Test
34/68
Suppose the mean score of all +# year old children onan an/iety scale is ).# and SD is *.#" ').#% '*.# $.
A research were interested in whether +# year oldchildren with alcoholic parents had a different meanscore on the an/iety scale.
The researcher drawn a sample including +E childrenand its mean is .+ "n'+E%/' .+ ̅ $ .
8/19/2019 4.T-Test
35/68
"teps…"teps…Setting up hypothesis and significance le!el
H #, ').# H +, ).# B'#.#5 "two tail$
8/19/2019 4.T-Test
36/68
Since the p !alue is less than the significancele!el% the effect is statistically significant.
Since the effect is significant% the nullhypothesis should be re ected.
it is concluded that the mean an/iety scoreof +# year old children with alcoholic parentsis higher than the population mean.
*.**.*
#.#+(#.#+( #.:)*
+.:E+.:E
8/19/2019 4.T-Test
37/68
How to express…How to express…
The results might be described in a report asfollows,
The mean score of children of alcoholic parents" alcoholic ' .+$ was significantly higher than thepopulation mean " ').#$% u'*.* and p'#.#* .
8/19/2019 4.T-Test
38/68
Summary of u-testSummary of u-test
Specify the null hypothesis and an alternati!ehypothesis
Set up the significance le!el "usual be #.#5$ and
specify two side or one side testse a u table or a special u B !alue "usual be +.:Etwo side or +.E(5 one side$ to determine p !alue
Make a rational conclusion
8/19/2019 4.T-Test
39/68
Assumption of u-test Assumption of u-test
4ormal distribution
Scores are independent
is known
The sample si&e is large enough " n ≥ =#$
Since the statistic is u% we call it u test.
8/19/2019 4.T-Test
40/68
Suppose a researcher wish to test whether themean score of fifth graders on a test of readingachie!ement in his or her city differed from thennational mean of )E. " ')E% but is unknown$
The researcher randomly sampled the scores of*# students.
The scores are shown as, )* E: : ) ) )E) EE 5 :) ( E )E ): * * :+E: )(. "we can get, n'*#%/' #. 5%s' . )$ ̅
8/19/2019 4.T-Test
41/68
"teps…"teps…Setting up hypothesis and significance le!el
H #, ')E H +, )E B'#.#5 "two tail$
8/19/2019 4.T-Test
42/68
Cont…Cont…
Since the probability !alue is less than thesignificance le!el %the effect is statisticallysignificant.
Since the effect is significant% the nullhypothesis should be re ected.
It is concluded that the mean readingachie!ement score of children in the city in3uestion is higher than the population mean.
8/19/2019 4.T-Test
43/68
How to express…How to express…
The results of this e/perimental result might bedescribed as follows,
The mean reading achie!ement score of fifthgrade children in the sample "/' #. 5 ̅ $ wassignificantly higher than the mean reading
achie!ement score nationally" ')E$% t " '+:$ '*.((and p'#.#*5.
8/19/2019 4.T-Test
44/68
Summary of t-testSummary of t-testSpecify the null hypothesis and an alternati!ehypothesis
Set up the significance le!el "usual be #.#5$ and
specify two side or one side test
se a t table to determine p !alue from t and df
Make a rational conclusion
8/19/2019 4.T-Test
45/68
Assumption of t-test Assumption of t-test
4ormal distribution
Scores are independent
Since the statistic is t% we call it t test.
8/19/2019 4.T-Test
46/68
The t test used when the scores are notindependent is sometimes called a correlated ttest and sometimes called a related paired ttest.
0hen the same sub ects are tested in twoe/perimental conditions% scores in the two
conditions are not independent becausesub ects who score well in one condition tend toscore well in the other condition.
8/19/2019 4.T-Test
47/68
%hat&s related#paired design?%hat&s related#paired design?
0hen the same sub ects are tested in twoe/perimental conditions
0hen a same sub ect is tested before it is treatedwith some therapies and it is tested again afterthe treatment is taken
The two !ery similar sub ects "twins$ is designedas a pair and they are tested in two e/perimentalconditions.
8/19/2019 4.T-Test
48/68
An e/perimenter interested in whether the time
it takes to respond to a !isual signal is differentfrom the time it takes to respond to an auditorysignal.
Ten sub ects are tested with both the !isualsignal and with the auditory signal.
To a!oid confounding with practice effects% halfare in the auditory condition first and the otherhalf are in the !isual task first.
8/19/2019 4.T-Test
49/68
The reaction times 'in milliseconds( are shown)The reaction times 'in milliseconds( are shown)sub ect isual Auditory
+ (*# = #* *=5 *=#
= * # =##
( =E# *E#5 =#5 *:5
E *+5 +:#
) *## *##(E# (+#
: =(5 ==#
+# =)5 = #
8/19/2019 4.T-Test
50/68
Compute the difference of two conditions)Compute the difference of two conditions)sub ect isual Auditory is Aud
+ (*# = # (#* *=5 *=# 5
= * # =## *#
( =E# *E# +##
5 =#5 *:5 +#
E *+5 +:# *5
) *## *## #
(E# (+# 5#: =(5 ==# +5
+# =)5 = # 5
Mean =+:.5 *:).5 **
8/19/2019 4.T-Test
51/68
"teps…"teps…Setting up hypothesis and significance le!el
H #, d '# H +, d # B'#.#5 "two tail$
8/19/2019 4.T-Test
52/68
Cont…Cont…
Since the probability !alue is more than thesignificance le!el %the effect does not reachstatistically significant.
Since the effect is no significant% the nullhypothesis should be not re ected.
It is concluded that the reaction times of the tensub ects in the two conditions are not different.
8/19/2019 4.T-Test
53/68
How to express…How to express…
The results of this e/perimental result might bedescribed as follows,
The mean time to respond to a !isual stimulus"mean'=+:.5$ was longer than the mean time torespond to a auditory stimulus "mean'*:).5$.
Howe!er% this difference was not statisticallysignificant% t " ':$ '*.#* and p'#.)(.
8/19/2019 4.T-Test
54/68
Summary of paired t-testSummary of paired t-test
8/19/2019 4.T-Test
55/68
Assumption of paired t-test Assumption of paired t-test
Jach sub ect is sampled, independently fromeach other sub ect.
The difference scores are normally distributed.If both raw scores are normally distributedthen the difference score will be normallydistributed too.
The two raw scores from each sub ect do notha!e to be independent of each other.
8/19/2019 4.T-Test
56/68
This section e/plains how to test the differencebetween group means for significance.
An e/periment was conducted comparing thememory of e/pert and no!ice chess players.
The mean number of pieces correctly placedacross se!eral chess positions was computed foreach sub ect and the scores for each sub ect.
8/19/2019 4.T-Test
57/68
The data of a!eragenumber of piecesrecalled for groupslists right.
The 3uestion iswhether the differencebetween the means ofthese two groups ofsub ects is statisticallysignificant.
4o!ices Tournament
=).+ (5.E=:.+ 5+.*
(#.5 5E.(
(5.5 5 .+
5+.= )+.+
5*.E )(.:
55.) )5.:
55.: #.=
5).) 5.=
8/19/2019 4.T-Test
58/68
Steps…Steps…
Setting up hypothesisH #, + ' * H +, + *
Setting up the significance le!el B'#.#5 "two tail$
8/19/2019 4.T-Test
59/68
Cont…Cont…
8/19/2019 4.T-Test
60/68
8/19/2019 4.T-Test
61/68
Cont…Cont…
the probability !alue for t can be determinedusing t table.
The degree of freedom for t is e3ual to "n + +$N"n* +$'n +Nn* *'+E.
So we can find the two tailed probability !alueof a t of =.)# with +E df is less than #.#5 fromthe t table " it is e/actly #.##+ $.
8/19/2019 4.T-Test
62/68
Cont…Cont…
Since the probability !alue is less than thesignificance le!el %the effect is statisticallysignificant.
Since the effect is significant% the nullhypothesis should be re ected.
It is concluded that the mean memory score fore/perts is higher than the mean memory scorefor no!ices.
8/19/2019 4.T-Test
63/68
How to express…How to express…
The results of this e/perimental result might bedescribed as follows,
The mean number of pieces recalled bytournament players "mean'( .=)$ wassignificantly higher than the mean number of
pieces recalled by no!ices "mean'E). $%t " '+E$ '=.)# and p'#.##+ .
8/19/2019 4.T-Test
64/68
Summary of two independent data t-testSummary of two independent data t-test
Specify the null hypothesis and an alternati!ehypothesis
Set up the significance le!el "usual be #.#5$ andspecify two side or one side test
8/19/2019 4.T-Test
65/68
Assumptions of two independent data t-test Assumptions of two independent data t-test
The populations are normally distributed
ariance in the two population should be e3ual
Scores are independent, each sub ect pro!ides
only one score
8/19/2019 4.T-Test
66/68
Exercises…Exercises…
The scores of a random sample of students ona physical test are gi!en. Test to see if thesample mean is significantly different from E5at the #.#5 le!el.
E# E* E) E: )# )* )5 #
xS
xt
0 µ −= '"E:.=)5 E5$9"E.559*. =$'+. :
df'n +')
d d − 0
8/19/2019 4.T-Test
67/68
Cont…Cont…A e/periment is conducted on the effect of alcohol on
perceptual motor ability. Ten sub ects are each testedtwice% once after ha!ing two drinks and once afterha!ing two glasses of water. The two tests were on twodifferent days to gi!e the alcohol a chance to wear off.
Half of the sub ects were gi!en alcohol first and halfwere gi!en water first. The scores of the +# students areshown below. The first number for each sub ect is theirperformance in the ?water@ condition. Higher scoresreflect better performance. Test to see if alcohol had asignificant effect at the #.#5 le!el.
first time, +E +5 ++ *# +: +( += +5 +( +E
second time, += += +* +E +E ++ +# +5 : +E
The paired t test should be applied
nS S
d t
d d
=−
=0
df'n +
8/19/2019 4.T-Test
68/68
Cont…Cont…
The scores on a !ocabulary test of a group of *#years old men and a group of E# years old menare shown below.
Test the difference for significance using the#.#5 le!el.
*# years old, *) *E *+ *( +5 + +) +* +=
E# years old, *E *: *: *: *) +5 *# *)
21
S
x xt
−
= ( ) ( )11 21 −+−= nnν