Example 1 We wanted to know if the American League or National League had better pitching – many people believe the NL has stronger pitching (which means lower scores). Are they correct at the p <.01 criterion? Data is part of the R file, run the first two lines of code to get it set up.
Step 1 Assumptions: – DV scale? Yes – ratio – Randomly select – yes, random assign – no – Normal? Unlikely don’t know, N < 30 – Homogeneity – SD they are roughly equal
Step 2 R: AL > NL N: AL <= NL
Step 3 Group 1 ALGroup 2 NL Mean SD N67 df56 Spooled1.23 Sdifference0.69
Formulas spooled = sqrt( ((n1-1)*sd1^2 + (n2-1)*sd2^2) / (n1+n2 - 2)) sdifference = sqrt((spooled^2/n1 + spooled^2/n2))
Step 4 qt(.01, 11, lower.tail = F) P <.01 Df total = Lower.tail = F because greater than test Critical t is 2.72
Step 5 Two Sample t-testdata: data$al and data$nl t = , df = 11, p-value = alternative hypothesis: true difference in means is greater than 099 percent confidence interval: Inf sample estimates: mean of x mean of y
Step 6 NOPE Fail to reject
Confidence Interval Confidence interval of mean difference – Most CI are two tailed – Using t.test() – 99 percent confidence interval:
Effect Size d =.81
Example 2 A while back, MSU considering changing their mascot to be more ferocious. Students rated their preference of mascot on a 1 to 5 scale. Did they prefer the new mascot? Use the p <.05 criterion. Data is built into the R code.
Step 1 Assumptions: – DV scale – yes, interval – Normal - I don’t know N < 30 – Random selection – nope, random assign - yes – Homogeneity – yes
Step 2 R: old < new N: old > = new
Step 3 Group 1 oldGroup 2 new Mean SD.971 N99 df88 Spooled.99 Sdifference,46
Step 4 Less than test P <.05 Df total = = 16 qt(.05, 16, lower.tail = T) T critical = -1.75
Step 5 Two Sample t-testdata: dataexp2$old and dataexp2$new t = , df = 16, p-value = alternative hypothesis: true difference in means is less than 0 95 percent confidence interval: -Inf sample estimates: mean of x mean of y
Step 6 Reject the null!
Confidence Interval Confidence interval of the mean difference 95 percent confidence interval:
Effect Size M1 = 2.78, SD = 0.97, SE = 0.32, 95%CI[ ] M2 = 3.67, SD = 1.00, SE = 0.33, 95%CI[ ] t(16) = -1.91, p = 0.07, d = -0.90, 95%CI[ ]