Chi-squared (χ2) (1.10.5) and F-tests (9.5.2) for the variance of a normal distribution χ2 tests for goodness of fit and indepdendence (3.5.4–3.5.5)
- Prof. Tesler
Math 283 Fall 2016
- Prof. Tesler
χ2 and F tests Math 283 / Fall 2016 1 / 41
Chi-squared ( 2 ) (1.10.5) and F -tests (9.5.2) for the variance of - - PowerPoint PPT Presentation
Chi-squared ( 2 ) (1.10.5) and F -tests (9.5.2) for the variance of a normal distribution 2 tests for goodness of fit and indepdendence (3.5.43.5.5) Prof. Tesler Math 283 Fall 2016 2 and F tests Prof. Tesler Math 283 / Fall 2016
χ2 and F tests Math 283 / Fall 2016 1 / 41
2
2
¯ x−µ0 σ/ √n or t = ¯ x−µ0 s/ √n (df =n−1)
2 vs. H1 : σ2 σ0 2
2 (df =n−1)
¯ x−¯ y
2 n + σY 2 m
¯ x−¯ y sp
n+ 1 m
2 = σY 2 vs. H1 : σX 2 σY 2
2/sX 2
χ2 and F tests Math 283 / Fall 2016 2 / 41
2 and σY 2.
2 and σY 2 could be performed to verify
2 = σY 2 (but doesn’t assume that this common
2 = σY 2 instead of H1 : σX 2 σY 2.
χ2 and F tests Math 283 / Fall 2016 3 / 41
9k)3
3.
3 as k → ∞.
x(k/2)−1e−x/2 2k/2Γ(k/2) :
2, rate λ = 1 2
χ2 and F tests Math 283 / Fall 2016 4 / 41
1 2 3 4 1 2 3 4 5 !2
1
pdf 1 2 3 4 5 6 0.1 0.2 0.3 0.4 0.5 !2
2
mean @ µ = 1 mean @ µ = 2 mode @ χ2 = 0 mode @ χ2 = 0 median @ χ2 = chi2inv(.5,1) = qchisq(.5,1) = 0.4549 median @ χ2 = chi2inv(.5,2) = qchisq(.5,2) = 1.3863
2 4 6 8 0.05 0.1 0.15 0.2 0.25 !2
3
pdf 2 4 6 8 10 12 14 16 0.02 0.04 0.06 0.08 0.1 0.12 !2
8
mean @ µ = 3 mean @ µ = 8 mode @ χ2 = 1 mode @ χ2 = 6 median @ χ2 = chi2inv(.5,3) = qchisq(.5,3) = 2.3660 median @ χ2 = chi2inv(.5,8) = qchisq(.5,8) = 7.3441
χ2 and F tests Math 283 / Fall 2016 5 / 41
2 4 6 8 10 12 0.00 0.05 0.10 0.15 2
5
2
,df
leftsided critical region 5 10 15 0.00 0.05 0.10 0.15 2
5
2
0.025,5 = 0.8312116
2
0.975,5 = 12.83250
2sided acceptance region: df=5, = 0.05
α,df as the number where the cdf (area left of it) is α: P(χ2 df χ2 α,df ) = α
0.025,5 = chi2inv(.025,5)
0.975,5 = chi2inv(.975,5)
χ2 and F tests Math 283 / Fall 2016 6 / 41
5 10 15 0.00 0.05 0.10 0.15 2
5
2
0.025,5 = 0.8312116
2
0.975,5 = 12.83250
2sided acceptance region: df=5, = 0.05
χ2 and F tests Math 283 / Fall 2016 7 / 41
1
2
n
1 n−1
i=1(xi − m)2.
3
σ02
i=1 (xi−m)2 σ02
σ02
10000
4
α/2,n−1 and χ2 1−α/2,n−1.
.025,5 = .8312, χ2 .975,5 = 12.8325
χ2 and F tests Math 283 / Fall 2016 8 / 41
0.00 0.05 0.10 0.15 χ5
2
pdf 37.69% 24.61% 37.69% 3.50 10 15 20 5.33 Supports H0 better Supports H1 better median=4.35
5 5.33) = 0.6231 is the area left of 5.33 for χ2 with 5 d.f.:
χ2 and F tests Math 283 / Fall 2016 9 / 41
.025,5 < χ2 < χ2 .975,5)
σ2
0.8312 > σ2 > (6−1)S2 12.8325
12.8325 , (6−1)S2 0.8312
(6−1)S2 12.8325 ,
0.8312
χ2 and F tests Math 283 / Fall 2016 10 / 41
1
k = Z12 + · · · + Zk2.
k is the “chi-squared distribution
2
3
n
σ0
2
χ2 and F tests Math 283 / Fall 2016 11 / 41
χ2 and F tests Math 283 / Fall 2016 12 / 41
r r−2 if r > 2
r(q−2) q(r+2) if q > 2
2r2(q+r−2) q(r−2)2(r−4) if r > 4
χ2 and F tests Math 283 / Fall 2016 13 / 41
1 2 3 0.5 1 1.5 2 2.5 1 2 3 0.2 0.4 0.6 0.8 1 1 2 3 0.2 0.4 0.6 0.8 1 1 2 3 0.5 1 1.5 2 F1,1 F1,2 F1,5 F1,10 F1,30 F1,100 F1,! F3,1 F3,2 F3,5 F3,10 F3,30 F3,100 F3,! F10,1 F10,2 F10,5 F10,10 F10,30 F10,100 F10,! F30,1 F30,2 F30,5 F30,10 F30,30 F30,100 F30,!
χ2 and F tests Math 283 / Fall 2016 14 / 41
1 2 3 4 5 6 7 8 0.1 0.2 0.3 0.4 0.5 0.6 F0.025,7,5=0.189 F0.975,7,5=6.853 2!sided acceptance region for F7,5, !=5% F7,5 pdf
χ2 and F tests Math 283 / Fall 2016 15 / 41
2 = σY 2
2 σY 2
2 = 10666.67,
2 = 4012.5,
2/sX 2 = 4012.5 10666.67 = 0.3762.
χ2 and F tests Math 283 / Fall 2016 16 / 41
χ2 and F tests Math 283 / Fall 2016 17 / 41
2 = σY 2
2 σY 2
2
2
n
2
2
2
m
2
2 = σY 2, the variances cancel:
2/σY 2
2/σX 2 = sY 2
2
2 = CσY 2
2 CσY 2
2/sX 2 instead.
χ2 and F tests Math 283 / Fall 2016 18 / 41
χ2 and F tests Math 283 / Fall 2016 19 / 41
χ2 and F tests Math 283 / Fall 2016 20 / 41
χ2 and F tests Math 283 / Fall 2016 21 / 41
16, 3 16, 3 16, 1 16)
χ2 and F tests Math 283 / Fall 2016 22 / 41
χ2 and F tests Math 283 / Fall 2016 23 / 41
3 = 0.4700240.
k−1 = k
χ2 and F tests Math 283 / Fall 2016 24 / 41
5 10 15 0.00 0.05 0.10 0.15 0.20 0.25 Supports H0 better Supports H1 better Observed !2 !2 pdf
3 0.4700240) = .9254259
χ2 and F tests Math 283 / Fall 2016 25 / 41
3 value supporting H0 better (lower
3) will be obtained, and about 92.5% of the time, values
3) will be obtained.
χ2 and F tests Math 283 / Fall 2016 26 / 41
χ2 and F tests Math 283 / Fall 2016 27 / 41
84
84 41.6056) = 0.00002873
84 41.6056) = 1 − 0.00002873 = .99997127.
χ2 and F tests Math 283 / Fall 2016 28 / 41
50 100 150 0.000 0.010 0.020 0.030 Supports H0 better
0.00002873 Supports H1 better
0.99997127 !84
2 = 41.6056
!84
2
χ2 and F tests Math 283 / Fall 2016 29 / 41
χ2 and F tests Math 283 / Fall 2016 30 / 41
χ2 and F tests Math 283 / Fall 2016 31 / 41
χ2 and F tests Math 283 / Fall 2016 32 / 41
χ2 and F tests Math 283 / Fall 2016 33 / 41
6 = 1073.5076.
χ2 and F tests Math 283 / Fall 2016 34 / 41
6 χ2 0.95,6 = 12.5916
6 1073.5076) ≈ 1.1 · 10−228
χ2 and F tests Math 283 / Fall 2016 35 / 41
5 10 15 20 25 30 0.00 0.06 0.12 !6
2
200 400 600 800 1000 1200 1400 0.00 0.06 0.12 Supports H0 better
Supports H1 better
= 1.1e−228 !6
2 = 1073.508
!6
2
χ2 and F tests Math 283 / Fall 2016 36 / 41
χ2 and F tests Math 283 / Fall 2016 37 / 41
χ2 and F tests Math 283 / Fall 2016 38 / 41
1 = .0070 + .0223 + .0208 + .0662 = 0.1163
0.95,1 = chi2inv(.95,1) = qchisq(.95,1) = 3.8415
1 > 0.1163) = 1-chi2cdf(0.1163,1) = 0.7331
χ2 and F tests Math 283 / Fall 2016 39 / 41
χ2 and F tests Math 283 / Fall 2016 40 / 41
χ2 and F tests Math 283 / Fall 2016 41 / 41