Lesso 7--7 Chaptre 3 Projects ad Had-is Project I: latest ovember Project I: latest december Laboratio Measuremet systems aalysis I: latest december Project - are volutary. Laboratio is obligatory. Give up to bous poit each to the exam 8 dec. Project - shall be doe idividually. Laboratio should be doe i groups (-4 persos). Projects ad laboratio is available o the homepage. Slide caliper ca be borrowed from the teacher. Hypothesis testig All employees Sample {74 66 7 74 7} x=7. s = 3.67 Legth N(µ,) Claim: The average legth of all employes is 7cm The sample average is = 7.cm. Är the claim true or ot?
Suppose that the legth of the employees N(7,3) cm. Geerereate radom samples of size. How uusual is our Hypotesis legth 8 6 4 7 7 73 74 7 76 77 78 79 Stickprovets medelvärde (cm) Our sample Hypotesis legth There are 7 sample averages less that 7. cm. There are 9879 sample averages greater tha 7. Our sample is rather uusual if the legth realley is N(7,3)-distributed. If the populatio mea legth were lower tha 7cm the should our sample ot be so uusual. Testig hypothesis Hypotesis a assumptio about the populatio (about a Testig hypotesis does the the sample data support the hypothesis or ot? H H Zero hypothesis Alterative hypothesis
Hypotesis examples Suppose that the average weight of a badage is g. H H µ = µ Toss a coi times. The fractio heads is p. H H p =. p >. Hypotesis test. Write dow zero hypothesis H.. Write dow alterative hypothesis H. 3. Decide a sigificace level α. 4. Decide a test fuctio (test statistica).. Take a radom sample ad calculate the values (mea, stadard deviatio et.c.) that are eeded i 6. Calculate a value o the test 7. Decide the critical area ad determie if the zero hypothesis ca be rejected or ot. zero hypothesis ad alterative Zero hypothesis H. H is a statemet of the populatio. Alterative hypothesis H. Complemet to H. Oe sided Double sided H : µ < 7cm H : µ 7cm 3
Sigificace level Sigificace show statistically sigificat differet (i swedish) Sigifikace level α The risk of rejectig H if H is true. Exemple: If the zero hypothesis is true ad α=. the o average the zero hypothesis will wrogly be rejected o average every test. Test fuctio The test fuctio is a fuctio fo the sample, ad hece is radom. Exampel ormally distributed values with kow variace : X µ Z = N(,) Sample ad test fuctio Take a sample Calculate the value of the test fuctio µ = 7 = 3 x = 7. = 7 7 z =.4 3 4
Critical area The critical area cotais the values where H is rejected. The limit of the critical area is called critical value. Is decided byt the sigificace level α. Critical area H is rejected Critical area H is rejected -3 - - 3 Test fuctio z Critical value z α/ Critical value z α/ Errors whe testig hypothesis H true H false Keep H. OK β-risk Reject H. α-risk OK α = P(Type I error) = P(reject H H is true) β = P(Type II error) = P(keep H H is false) Error whe testig hypothesis α is the sigifikace level of the test. - β is the power of the test. α is called producer risk. β is called cosumer risk.
P-value och sigificace level H was rejected o the level.. Was it ear the critical value or was it good margial? P-value is the lowest sigificace level for which H will be rejected. Exemple: p-value for the legth 7 cm is.. H is ot automatically true oly because it has ot bee rejected! H H H H : Smokig is ot dagerous. : Smokig is dagerous. : There is o life but o earth. : There is life outside earth. The fact that we have ot foud life o other plaets is o eveidece for that there is o life o ay other plaets. O the other had, if ET is foud the we ca reject H Employee legth All employees Sample Legth N(µ,) Estimate ˆ µ ad ˆ. 6
Estimatio of ormal distributio parameters. Normalfördeliges parameterar ka u skattas med: ˆ µ = x ˆ = s ˆ s Exemple legth A sample of size was take. {76 69 74 74 7} x=73.6 s =.7 The parameters ca ow be estimated to ˆ µ = x = 73.6 ˆ = = 7.3 s Ucertaity How sure ca we be that our estimatio is good eough? The sample averages varies from sample to sample. x = 73.6 x = 7.8 x3 = 76.8 x4 = 7. x = 74. x x x x 4 x3 7
Cofidece iterval A cofidece iterval [L, H] is a radom iterval that fulfills P( L µ H ) = α Eg. 9% cofidece iterval for µ is a iterval that with 9% probabilty cotais the true value of µ. The cofidece iterval decreases whe the sample size icreases. Cofidece iterval Cofidece level: The probability that the true value will be cotaied i the iterval. is deoted sometime as ( α). Cofidece itervals: Double sided Symmetrical Oe sided Exemple of deotatios: µ [,8 ] (9%) µ = 4 ± 4 (9%) Exemple 9% cofidece iterval radom N(,) samples of size. 3 of itervals does ot cotai. 4 4 3 3 -. - -... 8
Cofidece itervals for ormal distributio We wat to fid a cofidece iterval for the parameter µ for a N(µ,) distributed variable. ( H ) P L µ = α formulas depedig o if is kow. is ot kow. Average kow Let X be a N(µ,) distributed stochastic variable. Take a sample of size. The sample average is the: X N( µ, ) ad the ormalized value is X µ Z = N(,) Cofidece iterval for ormal distributio, kow variace Suppose that a ormally distributed N(µ,) sample of size. A ( α) cofidece iterval is the: x zα µ x + zα Z α/ is defied by (- α)% percetile of N(,). Z α Area = α/ 9
Sample average ukow variace If is ukow the the t-distributio should be used istead of the z- distributio. X µ T = t( υ) s t-distributio si symmetrical ad looks like the ormal distributio whe is big. The parameter ν=-deotes the degrees of freedom. Cofidece iterval ukow variace s x t µ x + t α α,, s Area = α/ t α, Sample size ad Type II -error How good is the test? H : H : µ = µ µ µ Z N(,) uder H δ Z N(,) uder H x µ Z = z α z α δ
Operatig-Characteristics curves, α=. β.9.8.7.6..4.3.. 3 4 3 δ δ β = Φ zα Φ zα... 3 3. 4 4. d ANOVA Aalysis of variace Aalysis of samples: chapter 3.4 Is used i measuremet systems aalysis i chapter 7 Compariso of may averages. Exemple: Mold tool with 6 cavities. y Cavity umber Cast r. 3 4 6 Average.77.79.8.83.84.86.87 3 3.77.77.79.78.8.8.83.8.8.86.87.88.88.8 4.77.79.8.8.8.87.8.78.78.8.8.83.87.8 6.8.79.8.83.84.8.8 4 6 7 Average.76.774.79.787.8.8.83.86.84.84.87.867.87.87 Is there a real differece betwee the cavities or is the variatio due to chace oly?
Mold tool. Model: i =...6 yij = µ + τ i + εij, j =...7 6 Suppose y N ( µ + τ, ) ij τ = i i= i Test hypotes: H : τ = τ = τ = to 6 H : τ for at least some i i Mold tool. We will use variatio aalysis (ANOVA). The idea is to divide the variatio ito two parts, oe that comes from the differece betwee the cavities ad aother that come from the variatio withi the cavities. Source of Sum of squares Degrees of variatio freedom Betwee a treatmets SS ( y y ) Treatmets i... i = Error (withi SS = SS SS N-a E T E treatmets) Total a N- SS = ( ) T y y ij.. i= j = a i. ij.. ij j= i= j= i. i..... y = y y = y N = a y = y y = y N Mea Square MS Treatmets MS E F MS F = MS Treatmets E Moldig tool..88 Matlab: aova(x).86.84 Values.8.8.78.76 3 4 6 Colum Number
Moldig tool, the residuals Study the residual eij = yij yi. -. -. -. -.......3 The assumptio seems OK! Probability.99.98.9.9.7...... Normal Probability Plot -. -. -. -...... Data 3