dataanalyse hypotesetest kursusgang 3
play

Dataanalyse - Hypotesetest - Kursusgang 3 Ege Rubak - - PowerPoint PPT Presentation

2 test Recap p -value Two sample tests Other goodness-of-fit checks Dataanalyse - Hypotesetest - Kursusgang 3 Ege Rubak - rubak@math.aau.dk http://www.math.aau.dk/ rubak/teaching/2010/nano4 19. februar 2010 1/20 Dataanalyse -


  1. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Dataanalyse - Hypotesetest - Kursusgang 3 Ege Rubak - rubak@math.aau.dk http://www.math.aau.dk/ ∼ rubak/teaching/2010/nano4 19. februar 2010 1/20 Dataanalyse - Kursusgang 3

  2. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Confidence interval for µ with known σ Sample with ( X 1 , . . . , X n ) independent, X i ∼ N ( µ, σ 2 ) . � We have: X ∼ N ( µ, σ 2 / n ) and Z = X − µ � ∼ N ( 0 , 1 ) . σ 2 / n � Therefore: � � z α/ 2 ≤ Z ≤ z 1 − α/ 2 = 1 − α, P where z α/ 2 is the α/ 2 quantile in N ( 0 , 1 ) . I.e. if α is 0 . 05 as usual we look up the 2 . 5 % quantile z 0 . 025 = − 1 . 96 and the 97 . 5 % quantile z 0 . 975 = 1 . 96 in the standard normal distribution N ( 0 , 1 ) . � I.e. the confidence interval is: σ σ √ n ; x + z 1 − α/ 2 √ n ] [ x + z α/ 2 2/20 Dataanalyse - Kursusgang 3

  3. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Confidence interval for µ with known σ Sample with ( X 1 , . . . , X n ) independent, X i ∼ N ( µ, σ 2 ) . � We have: X ∼ N ( µ, σ 2 / n ) and Z = X − µ � ∼ N ( 0 , 1 ) . σ 2 / n � Therefore: � � z α/ 2 ≤ Z ≤ z 1 − α/ 2 = 1 − α, P where z α/ 2 is the α/ 2 quantile in N ( 0 , 1 ) . I.e. if α is 0 . 05 as usual we look up the 2 . 5 % quantile z 0 . 025 = − 1 . 96 and the 97 . 5 % quantile z 0 . 975 = 1 . 96 in the standard normal distribution N ( 0 , 1 ) . � I.e. the confidence interval is: σ σ √ n ; x + z 1 − α/ 2 √ n ] [ x + z α/ 2 2/20 Dataanalyse - Kursusgang 3

  4. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Confidence interval for µ with known σ Sample with ( X 1 , . . . , X n ) independent, X i ∼ N ( µ, σ 2 ) . � We have: X ∼ N ( µ, σ 2 / n ) and Z = X − µ � ∼ N ( 0 , 1 ) . σ 2 / n � Therefore: � � z α/ 2 ≤ Z ≤ z 1 − α/ 2 = 1 − α, P where z α/ 2 is the α/ 2 quantile in N ( 0 , 1 ) . I.e. if α is 0 . 05 as usual we look up the 2 . 5 % quantile z 0 . 025 = − 1 . 96 and the 97 . 5 % quantile z 0 . 975 = 1 . 96 in the standard normal distribution N ( 0 , 1 ) . � I.e. the confidence interval is: σ σ √ n ; x + z 1 − α/ 2 √ n ] [ x + z α/ 2 2/20 Dataanalyse - Kursusgang 3

  5. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Hypothesis test for µ = µ 0 with known σ � Suppose we have a hypothesis H 0 : µ = µ 0 ( µ 0 is a known number). Assuming H 0 is true we can calculate Z = X − µ 0 � ∼ N ( 0 , 1 ) σ 2 / n for a given data set. This is called the Z -statistic, and if Z / ∈ [ z α/ 2 , z 1 − α/ 2 ] we reject H 0 . � This is the same as checking µ 0 is in the confidence interval σ σ [ x + z α/ 2 √ n ; x + z 1 − α/ 2 √ n ] � Sometimes called a z -test (e.g. in MATLAB). 3/20 Dataanalyse - Kursusgang 3

  6. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Hypothesis test for µ = µ 0 with known σ � Suppose we have a hypothesis H 0 : µ = µ 0 ( µ 0 is a known number). Assuming H 0 is true we can calculate Z = X − µ 0 � ∼ N ( 0 , 1 ) σ 2 / n for a given data set. This is called the Z -statistic, and if Z / ∈ [ z α/ 2 , z 1 − α/ 2 ] we reject H 0 . � This is the same as checking µ 0 is in the confidence interval σ σ [ x + z α/ 2 √ n ; x + z 1 − α/ 2 √ n ] � Sometimes called a z -test (e.g. in MATLAB). 3/20 Dataanalyse - Kursusgang 3

  7. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Hypothesis test for µ = µ 0 with known σ � Suppose we have a hypothesis H 0 : µ = µ 0 ( µ 0 is a known number). Assuming H 0 is true we can calculate Z = X − µ 0 � ∼ N ( 0 , 1 ) σ 2 / n for a given data set. This is called the Z -statistic, and if Z / ∈ [ z α/ 2 , z 1 − α/ 2 ] we reject H 0 . � This is the same as checking µ 0 is in the confidence interval σ σ [ x + z α/ 2 √ n ; x + z 1 − α/ 2 √ n ] � Sometimes called a z -test (e.g. in MATLAB). 3/20 Dataanalyse - Kursusgang 3

  8. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks When σ is unknown � Same same, but different! � Since σ 2 is unknown we use the estimator, S 2 ∼ σ 2 n − 1 χ 2 ( n − 1 ) , and we know T = X − µ � ∼ t ( n − 1 ) . (1) S 2 / n � The confidence interval is: s s [ x + t α/ 2 √ n ; x + t 1 − α/ 2 √ n ] (2) where t α/ 2 is the α/ 2 quantile in t ( n − 1 ) . � To test a hypothesis H 0 : µ = µ 0 we insert µ 0 in (1) and reject H 0 if the T -statistic is outside the interval [ t α/ 2 , t 1 − α/ 2 ] . This is the same as checking µ 0 is in the confidence interval (2). � Sometimes called a t -test. 4/20 Dataanalyse - Kursusgang 3

  9. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks When σ is unknown � Same same, but different! � Since σ 2 is unknown we use the estimator, S 2 ∼ σ 2 n − 1 χ 2 ( n − 1 ) , and we know T = X − µ � ∼ t ( n − 1 ) . (1) S 2 / n � The confidence interval is: s s [ x + t α/ 2 √ n ; x + t 1 − α/ 2 √ n ] (2) where t α/ 2 is the α/ 2 quantile in t ( n − 1 ) . � To test a hypothesis H 0 : µ = µ 0 we insert µ 0 in (1) and reject H 0 if the T -statistic is outside the interval [ t α/ 2 , t 1 − α/ 2 ] . This is the same as checking µ 0 is in the confidence interval (2). � Sometimes called a t -test. 4/20 Dataanalyse - Kursusgang 3

  10. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks When σ is unknown � Same same, but different! � Since σ 2 is unknown we use the estimator, S 2 ∼ σ 2 n − 1 χ 2 ( n − 1 ) , and we know T = X − µ � ∼ t ( n − 1 ) . (1) S 2 / n � The confidence interval is: s s [ x + t α/ 2 √ n ; x + t 1 − α/ 2 √ n ] (2) where t α/ 2 is the α/ 2 quantile in t ( n − 1 ) . � To test a hypothesis H 0 : µ = µ 0 we insert µ 0 in (1) and reject H 0 if the T -statistic is outside the interval [ t α/ 2 , t 1 − α/ 2 ] . This is the same as checking µ 0 is in the confidence interval (2). � Sometimes called a t -test. 4/20 Dataanalyse - Kursusgang 3

  11. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks When σ is unknown � Same same, but different! � Since σ 2 is unknown we use the estimator, S 2 ∼ σ 2 n − 1 χ 2 ( n − 1 ) , and we know T = X − µ � ∼ t ( n − 1 ) . (1) S 2 / n � The confidence interval is: s s [ x + t α/ 2 √ n ; x + t 1 − α/ 2 √ n ] (2) where t α/ 2 is the α/ 2 quantile in t ( n − 1 ) . � To test a hypothesis H 0 : µ = µ 0 we insert µ 0 in (1) and reject H 0 if the T -statistic is outside the interval [ t α/ 2 , t 1 − α/ 2 ] . This is the same as checking µ 0 is in the confidence interval (2). � Sometimes called a t -test. 4/20 Dataanalyse - Kursusgang 3

  12. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks When σ is unknown � Same same, but different! � Since σ 2 is unknown we use the estimator, S 2 ∼ σ 2 n − 1 χ 2 ( n − 1 ) , and we know T = X − µ � ∼ t ( n − 1 ) . (1) S 2 / n � The confidence interval is: s s [ x + t α/ 2 √ n ; x + t 1 − α/ 2 √ n ] (2) where t α/ 2 is the α/ 2 quantile in t ( n − 1 ) . � To test a hypothesis H 0 : µ = µ 0 we insert µ 0 in (1) and reject H 0 if the T -statistic is outside the interval [ t α/ 2 , t 1 − α/ 2 ] . This is the same as checking µ 0 is in the confidence interval (2). � Sometimes called a t -test. 4/20 Dataanalyse - Kursusgang 3

  13. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Example of hypothesis test � Suppose we measure the height of 100 people x 1 x 2 · · · x 100 178 cm 183 cm · · · 175 cm and calculate the estimate of the mean x = 178 and the estimate of the variance s 2 = 64 (i.e. s = 8). � We want to test H 0 : µ = 180 cm at level of significance α = 0 . 05. � Since t = 178 − 180 = − 2 . 5 , t 0 . 025 = − 1 . 98 , t 0 . 975 = 1 . 98 8 / 10 we reject H 0 . � What about with level of significance α = 0 . 01? In this case t 0 . 005 = − 2 . 63 , t 0 . 995 = 2 . 63 , and we cannot reject H 0 . 5/20 Dataanalyse - Kursusgang 3

  14. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Example of hypothesis test � Suppose we measure the height of 100 people x 1 x 2 · · · x 100 178 cm 183 cm · · · 175 cm and calculate the estimate of the mean x = 178 and the estimate of the variance s 2 = 64 (i.e. s = 8). � We want to test H 0 : µ = 180 cm at level of significance α = 0 . 05. � Since t = 178 − 180 = − 2 . 5 , t 0 . 025 = − 1 . 98 , t 0 . 975 = 1 . 98 8 / 10 we reject H 0 . � What about with level of significance α = 0 . 01? In this case t 0 . 005 = − 2 . 63 , t 0 . 995 = 2 . 63 , and we cannot reject H 0 . 5/20 Dataanalyse - Kursusgang 3

  15. χ 2 test Recap p -value Two sample tests Other goodness-of-fit checks Example of hypothesis test � Suppose we measure the height of 100 people x 1 x 2 · · · x 100 178 cm 183 cm · · · 175 cm and calculate the estimate of the mean x = 178 and the estimate of the variance s 2 = 64 (i.e. s = 8). � We want to test H 0 : µ = 180 cm at level of significance α = 0 . 05. � Since t = 178 − 180 = − 2 . 5 , t 0 . 025 = − 1 . 98 , t 0 . 975 = 1 . 98 8 / 10 we reject H 0 . � What about with level of significance α = 0 . 01? In this case t 0 . 005 = − 2 . 63 , t 0 . 995 = 2 . 63 , and we cannot reject H 0 . 5/20 Dataanalyse - Kursusgang 3

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend