1 / 25

HW: See Web Project proposal due next Thursday. See web for more detail.

This project proposal aims to develop materials for child's pajamas that take longer to burn. An experiment will be conducted to compare burn times of four different fabrics. The data collected will be analyzed using t-based confidence intervals and hypothesis tests.

jdoherty
Download Presentation

HW: See Web Project proposal due next Thursday. See web for more detail.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HW: See Web • Project proposal due next Thursday. See web for more detail.

  2. Inference from Small SamplesChapter 10 • Data from a manufacturer of child’s pajamas • Want to develop materials that take longer before they burn. • Run an experiment to compare four types of fabrics. (They considered other factors too, but we’ll only consider the fabrics. Source: Matt Wand)

  3. Fabric Data:Tried to light 4 samples of 4 different (unoccupied!) pajama fabrics on fire. 18 Higher #meanslessflamable Mean=16.85std dev=0.94 17 16 15 e m i 14 T n 13 r u B 12 Mean=10.95std dev=1.237 Mean=11.00std dev=1.299 11 Mean=10.50std dev=1.137 10 9 1 2 3 4 Fabric

  4. Confidence Intervals? • Suppose we want to make confidence intervals of mean “burn time” for each fabric type. • Can I use: x +/- za/2s/sqrt(n) for each one? • Why or why not?

  5. Answer: • Sample size (n=4) is too small to justify central limit theorem based normal approximation. • More precisely: • If xi is normal, then (x – m)/[s/sqrt(n)] is normal for any n. • xi is normal, then (x – m)/[s/sqrt(n)] is normal for n > 30. • New: Suppose xi is approximately normal (and an independent sample). Then (x – m)/[s/sqrt(n)] ~ tn-1 tn-1 is the “t distribution” with n-1 degrees of freedom (df) (number of data points used to estimate x) - 1

  6. What are degrees of freedom? • Think of them as a parameter • t-distribution has one parameter: df • Normal distribution has 2 parameters: mean and variance

  7. 0.4 0.3 0.2 density 0.1 0.0 -4 -2 0 2 4 x “Student” t-distribution (like a normal distribution, but w/ “heavier tails”) Idea: estimating stddev leads to “morevariability”. Morevariability = higher chance of “extreme”observation Normal dist’n t dist’t with 3df As df increases, tn-1 becomes the normal dist’n. Indistinguishable for n > 30 or so.

  8. t-based confidence intervals • 1-a level confidence interval for a mean: x +/- ta/2,n-1s/sqrt(n) where ta/2,n-1 is a number such thatPr(T > ta/2,n-1) = a/2 where T~tn-1 (see table opposite normal table inside of book cover…)

  9. Back to burn time example x s t0.025,3 95% CI Fabric 1 16.85 0.940 3.182 (15.35,18.35) Fabric 2 10.95 1.237 3.182 (8.98, 12.91) Fabric 3 10.50 1.137 3.182 (8.69, 12.31) Fabric 4 11.00 1.299 3.182 (8.93, 13.07)

  10. t-based Hypothesis test for a single mean • Mechanics: replace za/2 cutoff with ta/2,n-1ex: fabric 1 burn time data H0: mean is 15HA: mean isn’t 15Test stat: |(16.85-15)/(0.94/sqrt(4))| = 3.94 Reject at a=5% since 3.94>t0.025,3=3.182P-value = 2*Pr(T>3.94) where T~t3. This is between 2% and 5% since t0.025,3=3.182 and t0.01,3=4.541. (pvalue=2*0.0146) from software) • See minitab: basis statistics: 1 sample t test • Idea: t-based tests are harder to pass than large sample normal based test. Why does that make sense?

  11. Comparison of 2 means: • Example: • Is mean burn time of fabric 2 different from mean burn time of fabric 3? • Why can’t we answer this w/ the hypothesis test: H0: mean of fabric 2 = 10.5HA: mean of fabric 2 doesn’t = 10.5 • What’s the appropriate hypothesis test? x for fabric 3

  12. H0: mean fab 2 – mean fab 3 = 0 HA : mean fab 2 – mean fab 3 not = 0 • Let’s do this w/ a confidence interval (a=0.05). • 95% Large sample CI would be: (x2 – x3) +/- z0.05/2sqrt[s22/n2 + s23/n3] • Can’t use this because it will be “too narrow” (i.e. claim 95% CI but actually it’s an 89%...)

  13. CI is based on small sample distribution of difference between means. • That distribution is different depending on whether the variances of the two means are approximately equal equal or not • Small sample CI: • If var(fabric 2) is approximately = var(fabric 3), then just replace za/2 with ta/2,n2+n3-2df = n2+n3-2 = (n2-1)+(n3-1)This is called “pooling” the variances. • If not, then use software. (Software adjusts the degrees of freedom for an “appoximate” confidence interval.) Rule of thumb: OK if 1/3<(S23/S22)<3 Read section 10.4 More conservative

  14. Minitab: Stat: Basic statistics: 2 sample t Two-sample T for f2 vs f3 N Mean StDev SE Mean f2 4 10.95 1.24 0.62 f3 4 10.50 1.14 0.57 Difference = mu f2 - mu f3 Estimate for difference: 0.450 95% CI for difference: (-1.606, 2.506) T-Test of difference = 0 (vs not =): T-Value = 0.54 P-Value = 0.611 DF = 6 Both use Pooled StDev = 1.19

  15. Hypothesis test: comparison of 2 means • As in the 1 mean case, replace za/2 with the appropriate “t based” cutoff value. • When s21 approximately = s22 then test statistic is t=|(x1–x2)+/-sqrt(s21/n1+s22/n2)| Reject if t > ta/2,n1+n2-2 Pvalue = 2*Pr(T > t) where T~tn1+n2-2 For unequal variances, software adjusts df on cutoff.

  16. “Paired T-test” • In previous comparison of two means, the data from sample 1 and sample 2 were unrelated. (Fabric 2 and Fabric 3 observations are independent.) • Consider following experiment: • “separated identical twins” (adoption) experiments. • 15 sets of twins • 1 twin raised in city and 1 raised in country • measure IQ of each twin • want to compare average IQ of people raised in cities versus people raised in the country • since twins share common genetic make up, IQs within a pair of twins probably are not independent

  17. Data: One Way of Looking At it country city [1,] 117 118 [2,] 153 156 [3,] 73 71 [4,] 64 65 [5,] 95 109 [6,] 120 123 [7,] 94 88 [8,] 106 121 [9,] 90 95 [10,] 96 110 [11,] 67 66 [12,] 102 112 [13,] 111 110 [14,] 127 133 [15,] 180 180 = city = country 180 160 City mean = 110.47 140 IQ 120 100 Country mean = 106.33 80 60 2 4 6 8 10 12 14 The twins are“linked” by these #s Number

  18. country - city country city diff [1,] 117 118 -1 [2,] 153 156 -3 [3,] 73 71 2 [4,] 64 65 -1 [5,] 95 109 -14 [6,] 120 123 -3 [7,] 94 88 6 [8,] 106 121 -15 [9,] 90 95 -5 [10,] 96 110 -14 [11,] 67 66 1 [12,] 102 112 -10 [13,] 111 110 1 [14,] 127 133 -6 [15,] 180 180 0 5 0 IQ -5 Mean difference = -4.14(country – city) -10 -15 2 4 6 8 10 12 14 Index Of course, Mean difference = mean( country ) - mean( city ) If we want to test “difference = 0”, we need variance of differences.

  19. Paired t-test • One twin’s observation is dependent on the other twin’s observation, but the differences are independent across twins. • As a result, estimate var(differences) with sample variance of differences. • This is not the same as var( city ) + var( country) • As a result, we can do an ordinary one sample t-test on the differences. This is called a “paired t-test”. • When data naturally come in pairs and the pairs are related, a “paired t-test” is appropriate.

  20. “Paired T-test” • Minitab: basic statistics: paired t-test: Paired T for Country - City N Mean StDev SE Mean Country 15 106.33 31.03 8.01 City 15 110.47 31.73 8.19 Difference 15 -4.13 6.46 1.67 95% CI for mean difference: (-7.71, -0.56) T-Test of mean difference = 0 (vs not = 0): T-Value = -2.48 P-Value = 0.027 • Compare this to a 2-sample t-test

  21. Compare “Paired T-test” vs “2 sample t-test” Paired T for Country - City N Mean StDev SE Mean Country 15 106.33 31.03 8.01 City 15 110.47 31.73 8.19 Difference 15 -4.13 6.46 1.67 95% CI for mean difference: (-7.71, -0.56) T-Test of mean difference = 0 (vs not = 0): T-Value = -2.48 P-Value = 0.027 Two-sample T for Country vs City N Mean StDev SE Mean Country 15 106.3 31.0 8.0 City 15 110.5 31.7 8.2 Difference = mu Country - mu City Estimate for difference: -4.1 95% CI for difference: (-27.6, 19.3) T-Test of difference = 0 (vs not =): T-Value = -0.36 P-Value = 0.721 DF = 28 Both use Pooled StDev = 31.4

  22. Compare “Paired T-test” vs “2 sample t-test” • Estimate of difference is the same, • but the variance estimate is very different: • Paired: std dev(difference) = 1.67 • 2 sample: sqrt[ (31.0^2 /15) + (31.7^2/15) ] = 11.46 • “cutoff” is different (df) too: • t0.025,13 for paired • t0.025,28 for 2 sample

  23. Compare “Paired T-test” vs “2 sample t-test” • Estimate of difference is the same, • but the variance estimate is very different: • Paired: std dev(difference) = 1.67 • 2 sample: sqrt[ (31.0^2 /15) + (31.7^2/15) ] = 11.46 • “cutoff” is different (df) too: • t0.025,13 for paired • t0.025,28 for 2 sample

  24. Where we’ve been We can use data to address following questions: 1. Question: Is a mean = some number a. Answer: If n>30, large sample “Z” test and confidence interval for means (chapters 8 and 9) b. Answer: If n<=30 and data is approximately normal, then “t” test and confidence intervals for means (chapter 10) 2. Question: Is a proportion = some percentage Answer: If n>30, large sample “Z” test and confidence interval for proportions (chapters 8 and 9) If n<=30, t-test is not appropriate

  25. Where we’ve been 3. Question: Is a difference between two means = some # a. Answer: If n>30 and samples are independent (not paired), large sample “Z” test and confidence interval for means (chapters 8 and 9)b. Answer: If n<=30 and samples are independent (not paired), large sample “t” test and confidence interval for means (chapter 10)c. Answer: If samples are dependent, paired t-test (chap 10) 4. Question: Is a difference between two proportions = some % Answer: If n>30 and samples are independent, “Z” test for proportions (chapters 8 and 9) (no t-test…)

More Related