About

Init

library(pacman)
p_load(kirkegaard, haven, rms)
theme_set(theme_bw())

Data

d = read_sav("data/vHB_SESP_Datafile_for_sharing 29.8.15.sav")
d_vars = df_var_table(d)

#print variables for curiousity
d_vars

Analyses

#plot ethnic estimates
#intelligence
d$Eth.Int3 %>% describe() %>% as.matrix()
##    vars   n     mean       sd median  trimmed    mad min max range      skew
## X1    1 329 26.35258 26.00558     10 22.98113 14.826   0 100   100 0.9707898
##      kurtosis       se
## X1 -0.1941442 1.433734
GG_denhist(d, "Eth.Int3", binwidth = 10) +
  scale_x_continuous("Probability", breaks = seq(0, 100, 10)) +
  ggtitle("Imagine that science found that people in some ethnic groups were genetically more intelligent than people in other ethnic groups. In your opinion, how likely is it that this finding is actually true?" %>% add_newlines(line_length = 110),
          str_glue("n = {sum(!is.na(d$Eth.Int3))} social psychologist members of SESP. Vertical line shows the mean."))
## Warning: Removed 21 rows containing non-finite values (stat_bin).
## Warning: Removed 21 rows containing non-finite values (stat_density).
## Scale for 'x' is already present. Adding another scale for 'x', which will
## replace the existing scale.
## Warning: Removed 21 rows containing non-finite values (stat_bin).

## Warning: Removed 21 rows containing non-finite values (stat_density).

GG_save("figs/race_IQ_SESP.png")
## Warning: Removed 21 rows containing non-finite values (stat_bin).

## Warning: Removed 21 rows containing non-finite values (stat_density).
#athletic
d$Eth.Ath3 %>% describe() %>% as.matrix()
##    vars   n     mean       sd median  trimmed    mad min max range      skew
## X1    1 335 45.10448 27.55351     50 44.57249 29.652   0 100   100 0.0940961
##    kurtosis       se
## X1 -1.08823 1.505409
GG_denhist(d, "Eth.Ath3", binwidth = 10) +
  scale_x_continuous("Probability", breaks = seq(0, 100, 10)) +
  ggtitle("Imagine that science found that people in some ethnic groups were genetically more athletically gifted than people in other ethnic groups. In your opinion, how likely is it that this finding is actually true?" %>% add_newlines(line_length = 110),
          str_glue("n = {sum(!is.na(d$Eth.Ath3))} social psychologist members of SESP. Vertical line shows the mean."))
## Warning: Removed 15 rows containing non-finite values (stat_bin).
## Warning: Removed 15 rows containing non-finite values (stat_density).
## Scale for 'x' is already present. Adding another scale for 'x', which will
## replace the existing scale.
## Warning: Removed 15 rows containing non-finite values (stat_bin).

## Warning: Removed 15 rows containing non-finite values (stat_density).

GG_save("figs/race_athletic_SESP.png")
## Warning: Removed 15 rows containing non-finite values (stat_bin).

## Warning: Removed 15 rows containing non-finite values (stat_density).
#each other
GG_scatter(d, "Eth.Ath3", "Eth.Int3")
## `geom_smooth()` using formula 'y ~ x'

#with politics
d$Lib.Cons %>% describe() %>% as.matrix()
##    vars   n      mean       sd median   trimmed    mad min max range      skew
## X1    1 326 -2.895706 1.619548     -3 -3.053435 1.4826  -5   3     8 0.9148445
##     kurtosis         se
## X1 0.9092895 0.08969846
GG_scatter(d, "Lib.Cons", "Eth.Int3", text_pos = "tr") +
  scale_x_continuous("Where would you put yourself on a continuum from liberal to conservative?",
                     limits = c(-5, 5),
                     breaks = seq(-5, 5),
                     labels = c("-5\nVery liberal", seq(-4, 4), "5\nVery conservative")) +
  scale_y_continuous("Probability of genetic caused ethnic differences in intelligence")
## `geom_smooth()` using formula 'y ~ x'

GG_save("figs/race_IQ_politics_SESP.png")
## `geom_smooth()` using formula 'y ~ x'
GG_scatter(d, "Lib.Cons", "Eth.Ath3", text_pos = "tr") +
  scale_x_continuous("Where would you put yourself on a continuum from liberal to conservative?",
                     limits = c(-5, 5),
                     breaks = seq(-5, 5),
                     labels = c("-5\nVery liberal", seq(-4, 4), "5\nVery conservative")) +
  scale_y_continuous("Probability of genetic caused ethnic differences in athleticism")
## `geom_smooth()` using formula 'y ~ x'

GG_save("figs/race_athletic_politics_SESP.png")
## `geom_smooth()` using formula 'y ~ x'