Presentation is loading. Please wait.

Presentation is loading. Please wait.

t-tests Quantitative Data One group  1-sample t-test

Similar presentations


Presentation on theme: "t-tests Quantitative Data One group  1-sample t-test"— Presentation transcript:

1 t-tests Quantitative Data One group  1-sample t-test
Two independent groups  2-sample t-test Two dependent groups  Matched Pairs t-test t-Tests

2 A Full Reality t No longer know what s is!!!!!
What should be used instead? Our best guess at s  s Changes details, not the big picture t t-Tests

3 Student’s t-distribution
Compared to a standard normal (Z): Similarities symmetric about 0 approximately bell-shaped Differences more probability in the tails less probability in the center Exact shape depends on degrees-of-freedom (df) See HO for R work -4 -2 2 4 Z or t 10 df 5 df 2 df 1 df t-Tests

4 1-sample t-test Ho: m = mo (where mo = specific value) Statistic:
Test Statistic: Assume: s is UNknown n is large (so that the test stat follows a t-distribution) n > 40, OR n > 15 and histogram is not strongly skewed, OR Histogram is approximately normal When: Quantitative variable, one population sampled, s is UNknown. df = n-1 t-Tests

5 A Full Example In Health magazine reported (March/April 1990) that the average saturated fat in one pound packages of butter was 66%. A food company wants to determine if its brand significantly differs from this overall mean. They analyzed a random sample of 96 one pound packages of its butter. Test the company’s hypothesis at the 1% level. Variable n Mean St. Dev. Min ... %SatFat t-Tests

6 Practical Significance
Is there a real difference between 66% and 65.6% saturated fat? If the sample size is large enough, any hypothesis can be rejected. t-Tests

7 R Handout t-Tests

8 Example Data – Cottonmouths
Researchers have determined that a population of cottonmouth snakes must have an average litter size greater than 5.8 snakes in order for the population to grow. A sample of snake litters from this population was taken and the number of snakes in the litter was recorded in Cottonmouth.txt. Test, at a very conservative level, if the average litter size is large enough for the population to grow. Based on data from Blem, X. and X. Blem Journal of Herpetology 29: t-Tests

9 2-Sample t-test -- Examples
Do test scores differ between sections of a class? Is the average number of yew per m2 different between areas exposed to and areas protected from moose browsing? Does the time from ingesting a pill until a subject claims no more headache pain less for subjects given an experimental drug as compared to those given a placebo? t-Tests

10 What do those examples have in common?
All compare the mean of one group to the mean of another group compare two sections compare two areas of yew density compare two groups of subjects The samples are independent. t-Tests

11 2-sample t-test Ho: m1 = m (where the subscript is a sample index) Statistic: because m1=m2 same as m1-m2=0 - 0 Test Statistic: where sp2 is the pooled sample variance df = n1 + n2 - 2 t-Tests

12 2-sample t-test Assume: Are s12 & s22 parameters or statistics?
n1 + n2 is large (to use a t-distribution) n1 + n2 > 40, OR n1 + n2 > 15 and both histograms are not strongly skewed, OR both histograms are approximately normal the two samples are independent s12 = s22 Are s12 & s22 parameters or statistics? Hypothesis Test -- Levene’s Test Ho: s12 = s22 vs Ha: s12  s22 What do you do with the p-value? t-Tests

13 Levene’s Test Summary A hypothesis test within a hypothesis test.
Small p-values mean the variances are unequal. If Levene’s test is a reject, can not continue with the 2-sample t-test (as presented here). t-Tests

14 Are You Surprised by the SE for the difference in means?
Let’s do some algebra on the SE for a sample mean It is “similar” to the SE for a single sample mean t-Tests

15 2-sample t-test When: quantitative data, samples from two populations, samples are independent t-Tests

16 A Full Example A study of the effect of caffeine on muscle metabolism used 36 male volunteers who each underwent arm exercise tests. Eighteen of the men were randomly selected to take a capsule containing pure caffeine one hour before the test. The other men received a placebo capsule. During each exercise the subject's respiratory exchange ratio (RER) was measured. [RER is the ratio of CO2 produced to O2 consumed and is an indicator of whether energy is being obtained from carbohydrates or fats]. The question of interest to the experimenter was whether, on average and at the 5% level, caffeine changed mean RER. t-Tests

17 A Full Example Group n Mean StDev Min 1st Qu Median 3rd Qu Max
Caffeine Placebo Levene’s Test p-value = t-Tests

18 R Handout t-Tests

19 Example Data – Sex & Direction
A sample of 30 males and 30 female was taken to an unfamiliar wooded park and given spatial orientation tests, including pointing to the south. The absolute pointing error, in degrees, was recorded. The results are in the SexDirection.txt file on the webpage. Do men have a better sense of direction than women, at the 1% level? from Sholl, X, et al The relation of sex and sense of direction to spatial orientation in an unfamiliar environment. Journal of Environmental Psychology. 20:17-28. t-Tests

20 Matched-Pairs -- Examples
Each individual is given a simulated driving test before and after drinking two beers in one hour. Determine if driving score is lower after the two beers. One identical twin is raised by the genetic parents and the other by foster parents. Determine if there is a difference in IQ between the twins. t-Tests

21 What do the examples have in common?
The individuals are not independent the before and after driving scores for an individual must be kept together as a pair the twin’s IQ scores must be kept together as a pair This is called a matched-pairs design Sampling/experimental design creates dependent samples in an effort to reduce the observed natural variability Why try to reduce natural variability? Decreasing natural variability increases power! t-Tests

22 Analyzing Matched-Pairs
Find the difference between paired observations Treat differences as if they were the observed data Test the null hypothesis that the mean difference is equal to zero Thus, perform a 1-sample t-test on the differences t-Tests

23 Matched Pairs Data Before After 57 55 62 58 64 58 After-Before -2 -4
57 55 62 58 64 58 After-Before -2 -4 -6 These are then ignored!!! These are then analyzed as a 1-sample t-test t-Tests

24 Matched-Pairs t-test Ho: mdiff = 0 (where mdiff is the mean difference) Sample: random selection of n paired observations Assume: Original samples are dependent number of paired observations (n) is “large” n > 40, OR n > 15 and SAMPLE distribution (of differences) is not strongly skewed, OR SAMPLE distribution is approximately normal Statistic: Test Statistic: df = n-1 t-Tests

25 So ... Use the Matched-Pairs t-test when a quantitative variable was recorded on two samples that are dependent. Note, though, that this reduces to a 1-sample t-test on the differences. t-Tests

26 A Full Example Each of 25 randomly-selected students were given two tests on a driving simulator program. The first test was before the subject had drunk two beers in one hour. The second test was after the student had drunk the two beers. Determine if the two beers significantly negatively affected the student’s driving test score. Use a = 0.10 level (weak evidence is still evidence in this case). t-Tests

27 A Full Example Computer Output 10) Conclusion 11) Confidence region
Variable N Mean Median StDev SE Mean Diff (A-B) 10) Conclusion It appears that the driving test score for all students decreased significantly, on average, after two beers in one hour. 11) Confidence region One is 90% confident that the average difference in test scores for all students is less than This indicates that driving test scores decreased at least points, on average, after two beers in one hour. -3.0 -2.0 -1.0 0.0 1.0 2.0 1 2 3 4 5 Diff (A-B) Frequency t-Tests

28 Example Data – Gasoline Additive
A random sample of 22 cars was obtained. The gas mileage (mpg) of each car was determined both with and without an additive designed to raise gas mileage added to the gasoline. Test at the 5% level that the gas mileage increased significantly when the gas additive was used. Data in GasAdditive.txt t-Tests


Download ppt "t-tests Quantitative Data One group  1-sample t-test"

Similar presentations


Ads by Google