New Lecture 23

Selecting Sample Size
Larger n ® smaller confidence interval
Ex. 7.17 p 315
range = 520 about equal to 4 Σ
Σ = 520  4
130
[email protected] Σ  Sqrt@nD == 10, nD
88n ® 649.23<<
7.18
p1 = p2 = .03;
Clear@nD
lect23.nb
2
Solve@Hp1 H1 - p1L  n + p2 H1 - p2L  nL 1.96 ^ 2 Š .005 ^ 2, nD
88n ® 8943.24<<
Ex 8.1 p 338
Null Hypothesis : a statistical hypothesis to be tested and accepted
or rejected in favor of an alternative
http :  www.merriam - webster.com  dictionary  null %20 hypothesis
Null Hypothesis : p = .2
Alt Hypothesis p > .2
Test stat = ð of buyers, y
rejection region y >= 4 Harbitrary L
bd = BinomialDistribution @10, .2D
BinomialDistribution @10, 0.2D
Ex 8.2
Null hypothesis is true.
Error :
t = Table@8i, PDF@bd, iD<, 8i, 0, 10<D
980, 0.107374<, 81, 0.268435<, 82, 0.30199<, 83, 0.201327<,
84, 0.0880804 <, 85, 0.0264241 <, 86, 0.00550502 <, 87, 0.000786432 <,
88, 0.000073728 <, 99, 4.096 ´ 10-6 =, 910, 1.024 ´ 10-7 ==
lect23.nb
3
ListPlot@t, Filling ® AxisD
0.30
0.25
0.20
0.15
0.10
0.05
2
4
6
8
10
1 - CDF@bd, 3D
0.120874
Type 1 error alpha
p = .6
prob of type 2 error beta.
bd = BinomialDistribution @10, .6D
BinomialDistribution @10, 0.6D
t = Table@8i, PDF@bd, iD<, 8i, 0, 10<D
880, 0.000104858 <, 81, 0.00157286 <, 82, 0.0106168 <,
83, 0.0424673 <, 84, 0.111477<, 85, 0.200658<, 86, 0.250823<,
87, 0.214991<, 88, 0.120932<, 89, 0.0403108 <, 810, 0.00604662 <<
lect23.nb
4
ListPlot@t, Filling ® AxisD
0.25
0.20
0.15
0.10
0.05
2
4
6
8
CDF@bd, 3D
0.0547619
power :
1 - beta
Higher the power, the greater the prob. of rejecting the null
hypothesis when it ' s false.
Ex 8.4
p = .3
0.3
Find power
10
lect23.nb
5
bd = BinomialDistribution @10, .3D
BinomialDistribution @10, 0.3D
t = Table@8i, PDF@bd, iD<, 8i, 0, 10<D
980, 0.0282475 <, 81, 0.121061<, 82, 0.233474<, 83, 0.266828<,
84, 0.200121<, 85, 0.102919<, 86, 0.0367569 <, 87, 0.00900169 <,
88, 0.0014467 <, 89, 0.000137781 <, 910, 5.9049 ´ 10-6 ==
ListPlot@t, Filling ® AxisD
0.25
0.20
0.15
0.10
0.05
2
4
6
8
10
lect23.nb
6
1 - CDF@bd, 3D
0.350389
low power. Null hypothesis is false but we will often make mistakes
and accept it.
Ex. 8.5
null hyp mu = 72
n = 50
ybar = 74.1
s = 13.3
alpha = .1
In[974]:=
<< HypothesisTesting`
NormalCI@72, 13.3  Sqrt@50D, ConfidenceLevel -> .8D
869.5895, 74.4105<
CDF@NormalDistribution @72, 13.3  Sqrt@50DD, 74.4104755144819485` D
0.9
Therefore for ybar > 74.4105 we reject the null hyp.
H*or using tstat,
tstat=Hybar-ΜLHsSqrt@nDL*L
In[976]:=
Out[976]=
NormalCI@0, 1, ConfidenceLevel -> .8D
8- 1.28155, 1.28155<
Therefore for tstat > 1.281 we reject the null hyp.
lect23.nb
In[977]:=
7
tstat = H 74.1 - 72L  H13.3  Sqrt@50DL
0.2
Out[977]=
1.11648
0.15
The data does not support theory.
0.1
Ex. 8.6
0.05
Plot@PDF@NormalDistribution @78, 13.3  Sqrt@50DD, yD, 8y, 70, 90<D
75
80
85
90
… Graphics …
CDF@NormalDistribution @78, 13.3  Sqrt@50DD, 74.4104755144819485` D
0.0281695
Type 2 error HbetaL
8.7 Null Hypothesis Μ = .5; Althernate hypotheis Μ ¹ .5;