Illustrations using R B. Jones Dept. of Political Science UC-Davis
Data: Evaluations of African- American House Members Dep. Variable: Feeling thermometer Independent Variables: Race/Ethnicity Theory: Descriptive Representation Some Basic Statistics
Box Plots
Some Statistics > mean(imputed_if[race_respondent==1], na="TRUE") [1] (White) > mean(imputed_if[race_respondent==2], na="TRUE") [1] (Af. Am.) > mean(imputed_if[race_respondent==3], na="TRUE") [1] (Latino)
Simple t-tests: mu=50 > t.test(imputed_if, mu=50, alt="greater") One Sample t-test data: imputed_if t = , df = 1080, p-value < 2.2e-16 alternative hypothesis: true mean is greater than percent confidence interval: Inf sample estimates: mean of x > t.test(imputed_if, mu=50, alt="less") One Sample t-test data: imputed_if t = , df = 1080, p-value = 1 alternative hypothesis: true mean is less than percent confidence interval: -Inf sample estimates: mean of x > t.test(imputed_if, mu=50, alt="two.sided") One Sample t-test data: imputed_if t = , df = 1080, p-value < 2.2e-16 alternative hypothesis: true mean is not equal to percent confidence interval: sample estimates: mean of x
Difference-in-Means Tests Test 1: Af.-American survey respondents compared to Latino respondents. Hypothesis? 1-tail 2-tail Theory suggests 1-tail Null: mean ratings for the two groups are the same. 1-sided alternative: Af.-Am. respondents will have higher ratings than Latino.
Difference-in-Means > t.test(imputed_if[race_respondent==2], imputed_if[race_respondent==3], alt="greater") Welch Two Sample t-test data: imputed_if[race_respondent == 2] and imputed_if[race_respondent == 3] t = , df = , p-value = 4.075e-05 alternative hypothesis: true difference in means is greater than 0 95 percent confidence interval: Inf sample estimates: mean of x mean of y
Interpretation There is a significant difference between the two groups. The probability of a t-score of 4.05 or greater is nearly 0. Suggests the difference-in-means is probably not due to random chance alone.
Other Contrasts African-American vs. White 1-tail test? Whites vs. Latinos What is the alternative here? What is your theory underlying this hypothesis?
Difference-in-Means: Af.-Am. vs. White Respondents > t.test(imputed_if[race_respondent==2], imputed_if[race_respondent==1], alt="greater") Welch Two Sample t-test data: imputed_if[race_respondent == 2] and imputed_if[race_respondent == 1] t = , df = , p-value < 2.2e-16 alternative hypothesis: true difference in means is greater than 0 95 percent confidence interval: Inf sample estimates: mean of x mean of y
Difference-in-Means: White vs. Latino > t.test(imputed_if[race_respondent==1], imputed_if[race_respondent==3], alt="two.sided") Welch Two Sample t-test data: imputed_if[race_respondent == 1] and imputed_if[race_respondent == 3] t = , df = , p-value = alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: sample estimates: mean of x mean of y > t.test(imputed_if[race_respondent==1], imputed_if[race_respondent==3], alt="less") Welch Two Sample t-test data: imputed_if[race_respondent == 1] and imputed_if[race_respondent == 3] t = , df = , 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