Example: AA battery Brand name vs. generic batteries The same CD player, the same CD, volume at 5 6 pairs of AA alkaline batteries, randomized run order Brand nameGeneric 194.0190.7 205.5203.5 199.2203.5 172.4206.5 184.0222.5 169.5209.4
Plot the data Boxplot –Generic batteries lasted longer and were more consistent –Two outliers? –Is this difference really large enough?
Comparing two means Parameter of interest Standard error
Comparing Two Means (cont.) Because we are working with means and estimating the standard error of their difference using the data, we shouldn’t be surprised that the sampling model is a Student’s t. –The confidence interval we build is called a two-sample t-interval (for the difference in means). –The corresponding hypothesis test is called a two-sample t-test.
Sampling Distribution for the Difference Between Two Means When the conditions are met, the standardized sample difference between the means of two independent groups can be modeled by a Student’s t-model with a number of degrees of freedom found with a special formula. We estimate the standard error with
A two-sample t-interval Margin of error – –What degrees of freedom? Confidence interval
Assumptions and Conditions Independence –Randomization –10% condition Normal population assumption –Nearly normal condition –n<15, do not use these methods if seeing severe skewness –n<40, mildly skewness is OK. But should remark outliers –n>40, the CLT works well. The skewness does not matter much. Independent group assumption –Think about how the data are collected
Example: AA battery Parameter of interest Check conditions
Example: AA battery The sampling distribution is t with df=8.98 –Critical value for 95% CI –95% CI: (206.0-187.4)±16.5 = (2.1, 35.1)
Testing the difference between two means Price offered for a used camera buying from a friend vs. buying from a stranger. Does friendship has a measurable effect on pricing? Buying from a friendBuying from a stranger 275260 300250 260175 300130 255200 275225 290240 300
Two-sample t-test Null hypothesis T-test statistic Standard error df (by the complicated formula) P-value (one-sided or two-sided)
Example: friend vs. stranger Specify hypotheses Check conditions (boxplots) When conditions are satisfied, do a two- sample t-test –Observed difference 281.88-211.43 = 70.45 –se = 18.70 –Df = 7.622948 –P-value = 0.00600258 (two-sided)
Back Into the Pool Remember that when we know a proportion, we know its standard deviation. –Thus, when testing the null hypothesis that two proportions were equal, we could assume their variances were equal as well. –This led us to pool our data for the hypothesis test.
Back Into the Pool (cont.) For means, there is also a pooled t-test. –Like the two-proportions z-test, this test assumes that the variances in the two groups are equal. –But, be careful, there is no link between a mean and its standard deviation…
Back Into the Pool (cont.) If we are willing to assume or we are told that the variances of two means are equal, we can pool the data from two groups to estimate the common variance and make the degrees of freedom formula much simpler. We are still estimating the pooled standard deviation from the data, so we use Student’s t- model, and the test is called a pooled t-test.
The Pooled t-Test Estimate of the common variance se of the sample mean difference t-statistic
The Pooled t-Test Df = n 1 + n 2 – 2 Confidence interval
When should we pool? Most of the time, the difference is slight There is a test that can test this condition, but it is very sensitive to failure of assumptions and does not work well for small samples. In a comparative randomized experiment, experiment units are usually selected from the same population. If you think the treatment only changes the mean but not the variance, we can assume equal variances.
T-83 Plus –STAT TESTS + 0: 2-SampTInt Data: 2 Lists or STATS: Mean, sd, size of each sample Whether to pool the variance –STAT TESTS + 4: 2-SampTTest One-sided or two-sided Two-tail, lower-tail, upper-tail Whether to pool the variance
What Can Go Wrong? Watch out for paired data. –The Independent Groups Assumption deserves special attention. –If the samples are not independent, you can’t use two-sample methods. Look at the plots. –Check for outliers and non-normal distributions by making and examining boxplots.
What have we learned? We’ve learned to use statistical inference to compare the means of two independent groups. –We use t-models for the methods in this chapter. –It is still important to check conditions to see if our assumptions are reasonable. –The standard error for the difference in sample means depends on believing that our data come from independent groups, but pooling is not the best choice here. The reasoning of statistical inference remains the same; only the mechanics change.