2 Two Sample ProblemsThe goal of inference is to compare the responses to two treatments or to compare the characteristics of two populationsWe have a separate sample from each treatment or each populationThe response of each group are independent of those in other group
3 Conditions for Comparing 2 Means SRSTwo SRS’s from two distinct populationsMeasure same variable from both populationsNormalityBoth populations are Normally distributedIn practice, (large sample sizes for CLT to apply) similar shapes with no strong outliersIndependenceSamples are independent of each otherNi ≥ 10ni
4 2-Sample z Statistic Facts about sampling distribution of x1 – x2 Mean of x1 – x2 is 1 - 2 (since sample means are an unbiased estimator)Variance of the difference of x1 – x2 is If the two population distributions are Normal, then so is the distribution of x1 – x2σ1 σ2n1 n2² ²
5 2-Sample z StatisticSince we almost never know the population standard deviation (or for sure that the populations are normal), we very rarely use this in practice.
6 2-Sample t StatisticSince we don’t know the standard deviations we use the t-distribution for our test statistic. But we have a problem with calculating the degrees of freedom! We have two options:Let our calculator handle the complex calculations and tell us what the degrees of freedom areUse the smaller of n1 – 1 and n2 – 1 as a conservative estimate of the degrees of freedom
7 P-Value is the area highlighted Reject null hypothesis, if Classical and P-Value Approach – Two MeansP-Value is the area highlightedRemember to add the areas in the two-tailed!-tα-tα/2tα/2tαt0-|t0||t0|t0Critical Region(x1 – x2) – (μ1 – μ2 )t0 =s s22n n2Test Statistic:Reject null hypothesis, ifP-value < αLeft-TailedTwo-TailedRight-Tailedt0 < - tαt0 < - tα/2 or t0 > tα/2t0 > tα
8 t-Test StatisticSince H0 assumes that the two population means are the same, our test statistic is reduce to:Similar in form to all of our other test statistics(x1 – x2)t0 =s s22n n2Test Statistic:
9 Confidence Intervals Lower Bound: s12 s22 ----- + ----- Upper Bound:tα/2 is determined using the smaller of n1 -1 or n2 -1 degrees of freedomx1 and x2 are the means of the two sampless1 and s2 are the standard deviations of the two samplesNote: The two populations need to be normally distributed or the sample sizes larges sn n2(x1 – x2) – tα/2 ·PE ± MOEs sn n2(x1 – x2) + tα/2 ·
10 Two-sample, independent, T-Test on TI If you have raw data:enter data in L1 and L2Press STAT, TESTS, select 2-SampT-Testraw data: List1 set to L1, List2 set to L2 and freq to 1summary data: enter as beforeSet Pooled to NOcopy off t* value and the degrees of freedomConfidence Intervalsfollow hypothesis test steps, except select 2-SampTInt and input confidence level
11 Inference Toolbox Review Step 1: HypothesisIdentify population of interest and parameterState H0 and HaStep 2: ConditionsCheck appropriate conditionsStep 3: CalculationsState test or test statisticUse calculator to calculate test statistic and p-valueStep 4: InterpretationInterpret the p-value (fail-to-reject or reject)Don’t forget 3 C’s: conclusion, connection and context
12 Example 1Does increasing the amount of calcium in our diet reduce blood pressure? Subjects in the experiment were 21 healthy black men. A randomly chosen group of 10 received a calcium supplement for 12 weeks. The control group of 11 men received a placebo pill that looked identical. The response variable is the decrease in systolic (top #) blood pressure for a subject after 12 weeks, in millimeters of mercury. An increase appears as a negative response. Data summarized belowCalculate the summary statistics.Test the claimSubjects1234567891011Calcium-41817-3-5-2----Control-112-11
13 Example 1a Calculate the summary statistics. Subjects1234567891011Calcium-41817-3-5-2----Control-112-11GroupTreatmentNx-bars1Calcium105.0008.7432Control11-0.2735.901Looks like there might be a difference!
14 Example 1b Test the claim Hypotheses: GroupTreatmentNx-bars1Calcium105.0008.7432Control11-0.2735.9011 = mean decreases in black men taking calcium2 = mean decreases in black men taking placeboHO: 1 = 2Ha: 1 > 2orequivalentlyHO: 1 - 2 = 0Ha: 1 - 2 > 0
15 Example 1b cont Conditions: SRS Normality Independence The 21 subjects were not a random selection from all healthy black men. Hard to generalize to that population any findings. Random assignment of subjects to treatments should ensure differences due to treatments only.Sample size too small for CLT to apply; Plots Ok.Because of the randomization, the groups can be treated as two independent samples
16 Example 1b cont Calculations: Conclusions: df = min(11-1,10-1) = 9 (x1 – x2)t0 = = =s sn n2from calculator: t=1.6038p-value = df = 15.59Since p-value is above an = 0.05 level, we conclude that the difference in sample mean systolic blood pressures is not sufficient evidence to reject H0. Not enough evidence to support Calcium supplements lowering blood pressure.
17 Example 2Given the following data collected from two independently done simple random samples on average cell phone costs:Test the claim that μ1 > μ2 at the α = 0.05 level of significanceConstruct a 95% confidence interval about μ1 - μ2DataProvider 1Provider 2n2313x-bar43.141.0s4.55.1
18 Example 2a Cont Parameters Hypothesis H0: H1: Requirements: SRS: Normality: Independence:ui is average cell phone cost for provider iμ1 = μ2 (No difference in average costs)μ1 > μ2 (Provider 1 costs more than Provider 2)Stated in the problemHave to assume to work the problem. Sample size to small for CLT to applyStated in the problem
19 Example 2a Cont Calculation: Critical Value: x1 – x2 - 0 Conclusion:x1 – x2 - 0t0 =(s²1/n1) + (s²2/n2)= 1.237, p-value =tc(13-1,0.05) = 1.782, α = 0.05Since the p-value > (or that tc > t0), we would not have evidence to reject H0. The cell phone providers average costs seem to be the same.
20 Example 2b Confidence Interval: PE ± MOE s12 s22 ----- + ----- n n2(x1 – x2) ± tα/2 ·tc(13-1,0.025) = 2.1792.1 ± (20.25/23) + (26.01/13)2.1 ± (1.6974) = 2.1 ±[ , ] by hand[ , ] by calculatorIt uses a different way to calculate the degrees of freedom (as shown on pg 792)
21 DF - Welch and Satterthwaite Apx Using this approximation results in narrower confidence intervals and smaller p-values than the conservative approach mentioned before
22 Pooling Standard Deviations?? DON’TPooling assumes that the standard deviations of the two populations are equal – very hard to justify thisThis could be tested using the F-statistic (a non robust procedure beyond AP Stats)Beware: formula on AP Stat equation set under Descriptive Statistics
23 Summary and Homework Summary Homework Two sets of data are independent when observations in one have no affect on observations in the otherDifferences of the two means usually use a Student’s t-test of mean differencesThe overall process, other than the formula for the standard error, are the general hypothesis test and confidence intervals processHomework13.1, 7, 8, 13, 17