1 / 11

Illustrations using R

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.

Download Presentation

Illustrations using R

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Illustrations using R B. Jones Dept. of Political Science UC-Davis

  2. Data: Evaluations of African-American House Members • Dep. Variable: Feeling thermometer • Independent Variables: Race/Ethnicity • Theory: Descriptive Representation • Some Basic Statistics

  3. Box Plots

  4. Some Statistics > mean(imputed_if[race_respondent==1], na="TRUE") [1] 53.64732 (White) > mean(imputed_if[race_respondent==2], na="TRUE") [1] 69.92394 (Af. Am.) > mean(imputed_if[race_respondent==3], na="TRUE") [1] 61.45159 (Latino)

  5. Simple t-tests: mu=50 > t.test(imputed_if, mu=50, alt="greater") One Sample t-test data: imputed_if t = 19.0677, df = 1080, p-value < 2.2e-16 alternative hypothesis: true mean is greater than 50 95 percent confidence interval: 61.69999 Inf sample estimates: mean of x 62.8056 > t.test(imputed_if, mu=50, alt="less") One Sample t-test data: imputed_if t = 19.0677, df = 1080, p-value = 1 alternative hypothesis: true mean is less than 50 95 percent confidence interval: -Inf 63.9112 sample estimates: mean of x 62.8056 > t.test(imputed_if, mu=50, alt="two.sided") One Sample t-test data: imputed_if t = 19.0677, df = 1080, p-value < 2.2e-16 alternative hypothesis: true mean is not equal to 50 95 percent confidence interval: 61.48784 64.12335 sample estimates: mean of x 62.8056

  6. 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.

  7. 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 = 4.0562, df = 143.645, p-value = 4.075e-05 alternative hypothesis: true difference in means is greater than 0 95 percent confidence interval: 5.014392 Inf sample estimates: mean of x mean of y 69.92394 61.45159

  8. 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.

  9. Other Contrasts • African-American vs. White • 1-tail test? • Whites vs. Latinos • What is the alternative here? • What is your theory underlying this hypothesis?

  10. 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 = 10.2222, df = 670.663, p-value < 2.2e-16 alternative hypothesis: true difference in means is greater than 0 95 percent confidence interval: 13.65391 Inf sample estimates: mean of x mean of y 69.92394 53.64732

  11. 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 = -3.4508, df = 188.205, p-value = 0.00069 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -12.265597 -3.342931 sample estimates: mean of x mean of y 53.64732 61.45159 > 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 = -3.4508, df = 188.205, p-value = 0.000345 alternative hypothesis: true difference in means is less than 0 95 percent confidence interval: -Inf -4.06587 sample estimates: mean of x mean of y 53.64732 61.45159

More Related