1 Setup

Libraries and functions

knitr::opts_chunk$set(warning = FALSE, message = FALSE) 

Mypackages <-
  c("lme4","tidyverse","effects","ggplot2","psych",
    "MASS","Rmisc","lmerTest","ggthemes", "knitr",
    "lsmeans","pastecs","sjstats","car","ordinal",
    "Rcpp","corrplot", "ggpubr", "EnvStats",
    "easyStats", "cowplot","see","datawizard", "ggcorrplot")

# install.packages(Mypackages) #you must remove the # in this comment if you need to install the packages! 
lapply(Mypackages,
       require,
       character.only = TRUE)

options(knitr.kable.NA = '—')
set.seed(1)  

1.1 Load Data

# read in data files
setwd("~/Desktop")
gjg_raw <-read.csv("/Users/mtrenfield17/Desktop/Research/Boston College Research/Intergenerational Reciprocity/Intergenerational Reciprocity Pilot 2.csv")

1.2 Functions

plot_cooker <- function(data, iv, dv) {
  part1 <- ggplot(data, aes(x = {{iv}}, y = {{dv}}, fill = {{iv}})) +
    geom_violin(alpha = 0.3, scale = "count") +
    stat_summary(fun = "mean", geom = "point", size = 3, color = "black") +
    stat_summary(fun.data = mean_cl_normal, geom = "errorbar", width = 0.2, 
                 size = 1.5, color = "black") +
    scale_fill_manual(values = c("control" = "blue", "assuredSuccess" = "red", "uncertainSuccess" = "green")) +
    theme_classic()
  ggpar(part1, legend = "none")
}
  
pol_line <- function(data, iv, dv) {
  ggplot(data, aes(x = {{iv}}, y = {{dv}}, color = condition)) +
  stat_summary(fun.data = "mean_cl_normal", geom = "line") +
  geom_point(position = position_jitter(width = 0.1, height = 0.1), alpha = 0.5) +
  labs(x = "Political Leaning", color = "Condition")
}


lizy_cooker <- function(dv, iv, Title, x_axis_labs, y_label, sample_size, coln, rown) {
  part1 <- ggviolin(gjg, x = dv, y = iv, color = dv,
                    alpha = 0.1, fill = dv, xlab = "Motive",
                    trim = TRUE, ylab = y_label) +
    stat_summary(fun.data = "mean_cl_normal", geom = "crossbar", fatten = 1) +
    scale_y_continuous(breaks = c(1:7)) +
    labs(title = paste0(Title, " (n = ", sample_size, ")")) +
    theme(panel.background = element_rect(fill = "transparent"), 
          legend.position = "right",  ## Consider “gray97” for fill
          plot.title = element_text(face = "bold", hjust = 0.5, size = 16), 
          plot.subtitle = element_text(hjust = 0.5),
          panel.grid.major.y = element_line(color='grey75'), 
          axis.text.x = element_text(face = "plain", size = 13, color = "black"),
          axis.text.y = element_text(face = "plain", size = 13, color = "black"),
          axis.title.y = element_text(face = "plain", size = 13, color = "black", 
                                       margin = margin(t = 0, r = 10, b = 0, l = 0)), ## lower X axis title
          panel.border = element_rect(color = "black", fill = NA, size = 1)) +
  scale_color_discrete(name = "Condition") +
  facet_wrap(~ vignette, ncol = coln, nrow = rown, scales = "free", as.table = TRUE)
  ggpar(part1, legend = "none")
}

#POL_gjg_long <- filter(gjg_long, political_overall %in% c("Democrat", "Republican"))
  
#gjg_long$political_overall
#ggplot(gjg_long, aes(x = condition, y = p_approve, color = condition)) +
  #geom_point(stat="summary", fun="mean", size = 2) +
  #facet_wrap(~political_overall) +
  #scale_x_discrete(labels = NULL)

2 Attention Check

gjg_raw %>%
  group_by(attentionCheck) %>%
  dplyr::summarise(n = n()) %>%
  mutate(freq = n / sum(n))

0 participants failed the attention check.

2.1 Reshaping data

#### filtering people who failed the attn check ####
gjg <- gjg_raw %>% filter(attentionCheck == 3)

## changing condition to factor and reordering ##
gjg$condition <- as.factor(gjg$condition)
gjg$condition <- factor(gjg$condition, levels = c("control", "assuredSuccess", "uncertainSuccess"))

## Changing clicked to factor
gjg$clicked <- as.factor(gjg$clicked)


# changing numeric DVs to numeric
gjg <- gjg %>% mutate_at(vars(certaintyCheck1, certaintyCheck2, sacrificeCheck1, sacrificeCheck2, effortCheck1, effortCheck2, taxForFuture, renewableElectric, lifestylePG, thankfulPG, sacrificesPG, gratitudePG, futureImpact, futureSacrifice, futureResponsibility, moralMitigate, moralProtect, moralCollective, effortEfficacy, dayToDayEfficacyR, americansEfficacy1, americansEfficacy2, optimism, hope, intergenerational1, intergenerational2, american1, american2, pol, pid, edu, inc), as.numeric)

gjg_dem <- gjg %>% filter(gjg$pid_text == "Democrat")

3 Demographics

# Subset your data frame to include only the demographic columns
demo_gjg <- gjg[, c("gen", "race", "inc_text", "edu_text", "pol_text", "pid_text", "area")]

# Age
mean(gjg$age, na.rm=TRUE)
## [1] 38.94667
sd(gjg$age, na.rm=TRUE)
## [1] 14.00444
# Loop through each demographic column and calculate frequency counts
freq_tables <- list()

for (col in names(demo_gjg)) {
  {
    freq_table <- as.data.frame(table(demo_gjg[[col]]))
    freq_table$Percent <- round(freq_table$Freq / sum(freq_table$Freq) * 100, 2)
    freq_tables[[col]] <- freq_table
  }
}

# Print the frequency tables
for (i in seq_along(freq_tables)) {
  if (!is.null(freq_tables[[i]])) {
    cat("\nTable of frequencies for", names(freq_tables)[i], ":\n")
    print(freq_tables[[i]])
  }
}
## 
## Table of frequencies for gen :
##             Var1 Freq Percent
## 1 I identify as:    8    2.67
## 2            Man  144   48.00
## 3          Woman  148   49.33
## 
## Table of frequencies for race :
##                                                               Var1 Freq Percent
## 1                               American Indian and Native Alaskan    1    0.33
## 2                         American Indian and Native Alaskan,Black    1    0.33
## 3  American Indian and Native Alaskan,Hispanic or Latino/a/x,White    1    0.33
## 4                         American Indian and Native Alaskan,White    4    1.33
## 5                                                            Black   22    7.33
## 6                                     Black,Hispanic or Latino/a/x    2    0.67
## 7                               Black,Hispanic or Latino/a/x,White    1    0.33
## 8                                                       East Asian    8    2.67
## 9                                                 East Asian,White    3    1.00
## 10                                          Hispanic or Latino/a/x   15    5.00
## 11   Hispanic or Latino/a/x,Middle Eastern and North African,White    1    0.33
## 12                                    Hispanic or Latino/a/x,White    7    2.33
## 13                          Middle Eastern and North African,White    1    0.33
## 14                                                     South Asian    4    1.33
## 15                                                 Southeast Asian    3    1.00
## 16                                           Southeast Asian,White    1    0.33
## 17                                                           White  225   75.00
## 
## Table of frequencies for inc_text :
##                  Var1 Freq Percent
## 1 $100,000 - $149,999   41   13.67
## 2 $150,000 - $199,999   17    5.67
## 3   $25,000 - $49,999   58   19.33
## 4   $50,000 - $74,999   56   18.67
## 5   $75,000 - $99,999   54   18.00
## 6   less than $25,000   63   21.00
## 7  more than $200,000   11    3.67
## 
## Table of frequencies for edu_text :
##                                                   Var1 Freq Percent
## 1                                    Bachelor's degree  105   35.00
## 2                  Graduate degree (Masters, PhD, etc)   57   19.00
## 3                           High school diploma or GED   40   13.33
## 4 Some college, Technical degree, or Associates degree   93   31.00
## 5 Some schooling, but no high school diploma or degree    5    1.67
## 
## Table of frequencies for pol_text :
##                    Var1 Freq Percent
## 1          Conservative   29    9.67
## 2               Liberal   67   22.33
## 3              Moderate   66   22.00
## 4 Somewhat Conservative   27    9.00
## 5      Somewhat Liberal   48   16.00
## 6     Very Conservative   15    5.00
## 7          Very Liberal   48   16.00
## 
## Table of frequencies for pid_text :
##                  Var1 Freq Percent
## 1            Democrat  142   47.33
## 2 Independent / Other  103   34.33
## 3          Republican   55   18.33
## 
## Table of frequencies for area :
##       Var1 Freq Percent
## 1    Rural   46   15.33
## 2 Suburban  157   52.33
## 3    Urban   97   32.33

4 Correlations

gjg$clickedNum <- as.numeric(gjg$clicked)
DVs <- gjg[c("clickedNum", "certaintyCheck1","certaintyCheck2","sacrificeCheck1","sacrificeCheck2","effortCheck1", "effortCheck2","taxForFuture","renewableElectric","lifestylePG","thankfulPG", "sacrificesPG","gratitudePG","futureImpact","futureSacrifice","futureResponsibility","moralMitigate", "moralProtect","moralCollective","effortEfficacy","dayToDayEfficacyR", "americansEfficacy1","americansEfficacy2","optimism","hope","intergenerational1", "intergenerational2", "american1", "american2", "pol", "pid", "edu", "inc")]

# Compute pairwise correlations
corr_DVs <- cor(DVs, use = "complete.obs")

# Plot the correlation matrix
corrplot(corr_DVs, is.corr = TRUE, type = "lower", lower = "circle", tl.cex = 0.7, insig = "label_sig", diag = FALSE)

levels(gjg$condition)
## [1] "control"          "assuredSuccess"   "uncertainSuccess"
gjgU <- gjg %>% filter(condition == "uncertainSuccess")
cor.test(gjgU$moralMitigate, gjgU$taxForFuture)
## 
##  Pearson's product-moment correlation
## 
## data:  gjgU$moralMitigate and gjgU$taxForFuture
## t = 7.3901, df = 100, p-value = 4.539e-11
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.4521088 0.7070776
## sample estimates:
##       cor 
## 0.5943281
gjgC <- gjg %>% filter(condition == "control")
cor.test(gjgC$moralMitigate, gjgC$taxForFuture)
## 
##  Pearson's product-moment correlation
## 
## data:  gjgC$moralMitigate and gjgC$taxForFuture
## t = 6.3452, df = 96, p-value = 7.302e-09
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.3868838 0.6697591
## sample estimates:
##       cor 
## 0.5435765
DVs <- gjgU[c("certaintyCheck1","certaintyCheck2","sacrificeCheck1","sacrificeCheck2","effortCheck1", "effortCheck2","taxForFuture","renewableElectric","lifestylePG","thankfulPG", "sacrificesPG","gratitudePG","futureImpact","futureSacrifice","futureResponsibility","moralMitigate", "moralProtect","moralCollective","effortEfficacy","dayToDayEfficacyR", "americansEfficacy1","americansEfficacy2","optimism","hope","intergenerational1", "intergenerational2", "american1", "american2", "pol", "pid", "edu", "inc")]

# Compute pairwise correlations
Ccorr_DVs <- cor(DVs, use = "complete.obs")

# Plot the correlation matrix
corrplot(corr_DVs, is.corr = TRUE, type = "lower", lower = "circle", tl.cex = 0.7, insig = "label_sig", diag = FALSE)

5 Factor Analysis

6 Manipulation Check

percep_plot_list <- list(plot_cooker(gjg, condition, certaintyCheck1),
                         plot_cooker(gjg, condition, certaintyCheck2),
                         plot_cooker(gjg, condition, effortCheck1),
                         plot_cooker(gjg, condition, effortCheck2),
                         plot_cooker(gjg, condition, sacrificeCheck1),
                         plot_cooker(gjg, condition, sacrificeCheck2))

percep_plot_arranged <- ggarrange(plotlist = percep_plot_list, ncol = 3, nrow = 2)

overall_percep_title <- ggdraw() +
  draw_label("Manipulation Check DVs", fontface = "bold")

plot_grid(overall_percep_title, percep_plot_arranged, ncol = 1, rel_heights = c(0.1, 0.9))

pol_line(gjg, pol, certaintyCheck1)

pol_line(gjg, pol, certaintyCheck2)

pol_line(gjg, pol, effortCheck1)

pol_line(gjg, pol, effortCheck2)

pol_line(gjg, pol, sacrificeCheck1)

pol_line(gjg, pol, sacrificeCheck2)

gjg$condition <- relevel(gjg$condition, ref = "control")
mod_certaintyCheck1 <- lm(certaintyCheck1 ~ condition, data = gjg)
summary(mod_certaintyCheck1)
## 
## Call:
## lm(formula = certaintyCheck1 ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3300 -0.8776 -0.2745  0.7255  3.1224 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.8776     0.1117  25.768   <2e-16 ***
## conditionassuredSuccess     1.4524     0.1571   9.243   <2e-16 ***
## conditionuncertainSuccess   0.3970     0.1564   2.539   0.0116 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.105 on 297 degrees of freedom
## Multiple R-squared:  0.2359, Adjusted R-squared:  0.2307 
## F-statistic: 45.84 on 2 and 297 DF,  p-value: < 2.2e-16
gjg_aRef <- gjg
gjg_aRef$condition <- relevel(gjg_aRef$condition, ref = "assuredSuccess")
mod_aCertaintyCheck1 <- lm(certaintyCheck1 ~ condition, data = gjg_aRef)
summary(mod_aCertaintyCheck1)
## 
## Call:
## lm(formula = certaintyCheck1 ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3300 -0.8776 -0.2745  0.7255  3.1224 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 4.3300     0.1105  39.169  < 2e-16 ***
## conditioncontrol           -1.4524     0.1571  -9.243  < 2e-16 ***
## conditionuncertainSuccess  -1.0555     0.1556  -6.785  6.3e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.105 on 297 degrees of freedom
## Multiple R-squared:  0.2359, Adjusted R-squared:  0.2307 
## F-statistic: 45.84 on 2 and 297 DF,  p-value: < 2.2e-16
mod_certaintyCheck2 <- lm(certaintyCheck2 ~ condition, data = gjg)
summary(mod_certaintyCheck2)
## 
## Call:
## lm(formula = certaintyCheck2 ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3600 -1.0918 -0.0918  0.6863  2.9082 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.0918     0.1165  26.535  < 2e-16 ***
## conditionassuredSuccess     1.2682     0.1640   7.735 1.63e-13 ***
## conditionuncertainSuccess   0.2219     0.1632   1.360    0.175    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.153 on 297 degrees of freedom
## Multiple R-squared:  0.1878, Adjusted R-squared:  0.1824 
## F-statistic: 34.35 on 2 and 297 DF,  p-value: 3.82e-14
mod_aCertaintyCheck2 <- lm(certaintyCheck2 ~ condition, data = gjg_aRef)
summary(mod_aCertaintyCheck2)
## 
## Call:
## lm(formula = certaintyCheck2 ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3600 -1.0918 -0.0918  0.6863  2.9082 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 4.3600     0.1153  37.798  < 2e-16 ***
## conditioncontrol           -1.2682     0.1640  -7.735 1.63e-13 ***
## conditionuncertainSuccess  -1.0463     0.1623  -6.445 4.65e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.153 on 297 degrees of freedom
## Multiple R-squared:  0.1878, Adjusted R-squared:  0.1824 
## F-statistic: 34.35 on 2 and 297 DF,  p-value: 3.82e-14
mod_effortCheck1 <- lm(effortCheck1 ~ condition, data = gjg)
summary(mod_effortCheck1)
## 
## Call:
## lm(formula = effortCheck1 ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.9000 -0.8137  0.1000  0.8469  2.8469 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.15306    0.09509   22.64   <2e-16 ***
## conditionassuredSuccess    1.74694    0.13380   13.06   <2e-16 ***
## conditionuncertainSuccess  1.66066    0.13315   12.47   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9413 on 297 degrees of freedom
## Multiple R-squared:  0.4216, Adjusted R-squared:  0.4177 
## F-statistic: 108.2 on 2 and 297 DF,  p-value: < 2.2e-16
mod_aeffortCheck1 <- lm(effortCheck1 ~ condition, data = gjg_aRef)
summary(mod_aeffortCheck1)
## 
## Call:
## lm(formula = effortCheck1 ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.9000 -0.8137  0.1000  0.8469  2.8469 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.90000    0.09413  41.431   <2e-16 ***
## conditioncontrol          -1.74694    0.13380 -13.056   <2e-16 ***
## conditionuncertainSuccess -0.08627    0.13247  -0.651    0.515    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9413 on 297 degrees of freedom
## Multiple R-squared:  0.4216, Adjusted R-squared:  0.4177 
## F-statistic: 108.2 on 2 and 297 DF,  p-value: < 2.2e-16
mod_effortCheck2 <- lm(effortCheck2 ~ condition, data = gjg)
summary(mod_effortCheck2)
## 
## Call:
## lm(formula = effortCheck2 ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7300 -0.7300  0.1961  0.7041  2.7041 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.29592    0.09309   24.66   <2e-16 ***
## conditionassuredSuccess    1.43408    0.13098   10.95   <2e-16 ***
## conditionuncertainSuccess  1.50800    0.13035   11.57   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9215 on 297 degrees of freedom
## Multiple R-squared:  0.3621, Adjusted R-squared:  0.3578 
## F-statistic: 84.28 on 2 and 297 DF,  p-value: < 2.2e-16
mod_aeffortCheck2 <- lm(effortCheck2 ~ condition, data = gjg_aRef)
summary(mod_aeffortCheck2)
## 
## Call:
## lm(formula = effortCheck2 ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7300 -0.7300  0.1961  0.7041  2.7041 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.73000    0.09215   40.48   <2e-16 ***
## conditioncontrol          -1.43408    0.13098  -10.95   <2e-16 ***
## conditionuncertainSuccess  0.07392    0.12968    0.57    0.569    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9215 on 297 degrees of freedom
## Multiple R-squared:  0.3621, Adjusted R-squared:  0.3578 
## F-statistic: 84.28 on 2 and 297 DF,  p-value: < 2.2e-16
mod_sacrificeCheck1 <- lm(sacrificeCheck1 ~ condition, data = gjg)
summary(mod_sacrificeCheck1)
## 
## Call:
## lm(formula = sacrificeCheck1 ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.2647 -1.0102 -0.0102  0.7353  1.9898 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.01020    0.09463  21.243  < 2e-16 ***
## conditionassuredSuccess    1.09980    0.13315   8.260 4.88e-15 ***
## conditionuncertainSuccess  1.25450    0.13251   9.467  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9368 on 297 degrees of freedom
## Multiple R-squared:  0.2625, Adjusted R-squared:  0.2575 
## F-statistic: 52.85 on 2 and 297 DF,  p-value: < 2.2e-16
mod_asacrificeCheck1 <- lm(sacrificeCheck1 ~ condition, data = gjg_aRef)
summary(mod_asacrificeCheck1)
## 
## Call:
## lm(formula = sacrificeCheck1 ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.2647 -1.0102 -0.0102  0.7353  1.9898 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.11000    0.09368  33.199  < 2e-16 ***
## conditioncontrol          -1.09980    0.13315  -8.260 4.88e-15 ***
## conditionuncertainSuccess  0.15471    0.13183   1.174    0.242    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9368 on 297 degrees of freedom
## Multiple R-squared:  0.2625, Adjusted R-squared:  0.2575 
## F-statistic: 52.85 on 2 and 297 DF,  p-value: < 2.2e-16
mod_sacrificeCheck2 <- lm(sacrificeCheck2 ~ condition, data = gjg)
summary(mod_sacrificeCheck2)
## 
## Call:
## lm(formula = sacrificeCheck2 ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.2941 -0.2941 -0.1225  0.7059  1.8776 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.12245    0.09496  22.351  < 2e-16 ***
## conditionassuredSuccess    1.05755    0.13362   7.914 4.97e-14 ***
## conditionuncertainSuccess  1.17167    0.13297   8.811  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9401 on 297 degrees of freedom
## Multiple R-squared:  0.2396, Adjusted R-squared:  0.2345 
## F-statistic:  46.8 on 2 and 297 DF,  p-value: < 2.2e-16
mod_asacrificeCheck2 <- lm(sacrificeCheck2 ~ condition, data = gjg_aRef)
summary(mod_asacrificeCheck2)
## 
## Call:
## lm(formula = sacrificeCheck2 ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.2941 -0.2941 -0.1225  0.7059  1.8776 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.18000    0.09401  33.827  < 2e-16 ***
## conditioncontrol          -1.05755    0.13362  -7.914 4.97e-14 ***
## conditionuncertainSuccess  0.11412    0.13229   0.863    0.389    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9401 on 297 degrees of freedom
## Multiple R-squared:  0.2396, Adjusted R-squared:  0.2345 
## F-statistic:  46.8 on 2 and 297 DF,  p-value: < 2.2e-16

7 Behavioral Outcomes

percep_plot_list <- list(plot_cooker(gjg, condition, taxForFuture),
                         plot_cooker(gjg, condition, renewableElectric))

percep_plot_arranged <- ggarrange(plotlist = percep_plot_list, ncol = 2, nrow = 1)

ggplot(gjg, aes(x = clicked, fill = condition)) +
  geom_bar(position = "dodge") +
  labs(title = "Frequency of 'clicked' by condition", x = "Clicked", y = "Frequency") +
  scale_fill_manual(values = c("control" = "blue", "assuredSuccess" = "red", "uncertainSuccess" = "green"))

overall_percep_title <- ggdraw() +
  draw_label("Behavioral DVs", fontface = "bold")

plot_grid(overall_percep_title, percep_plot_arranged, ncol = 1, rel_heights = c(0.1, 0.9))

pol_line(gjg, pol, taxForFuture)

pol_line(gjg, pol, renewableElectric)

pol_line(gjg, pol, clicked)

gjg$renewableElectric
##   [1] 4 5 3 5 6 7 4 7 5 7 5 7 6 6 4 3 6 6 5 6 7 3 6 3 1 3 1 5 1 6 3 5 7 4 4 5 5
##  [38] 6 3 6 6 4 6 7 3 4 4 6 1 7 6 6 5 6 2 6 4 7 1 3 7 5 4 5 6 5 7 3 7 4 7 7 6 4
##  [75] 6 5 5 7 3 6 7 7 3 6 6 4 6 6 7 3 7 6 4 1 5 5 1 4 6 6 7 2 7 6 6 1 5 1 6 1 3
## [112] 5 5 7 6 5 3 7 2 4 7 5 1 5 6 7 7 3 6 4 4 5 7 5 7 6 7 3 6 7 2 7 5 4 7 1 1 4
## [149] 5 3 5 7 7 7 2 6 7 6 5 4 7 7 5 6 6 7 6 3 2 6 5 6 2 5 1 6 1 7 5 2 4 7 2 6 2
## [186] 6 3 5 7 5 5 7 6 5 5 6 7 4 2 7 7 5 6 7 5 7 6 6 6 5 6 7 1 7 3 7 5 5 5 4 6 5
## [223] 7 7 1 1 4 7 3 5 6 7 7 1 6 2 6 7 7 4 2 4 7 5 3 3 7 4 7 3 2 1 7 6 6 6 5 6 4
## [260] 7 4 6 1 6 4 7 3 6 3 5 6 5 2 2 7 1 7 7 5 2 6 1 2 1 7 4 3 7 5 7 6 6 5 2 6 1
## [297] 5 7 1 4
gjg$pid
##   [1] 1 1 1 1 1 3 2 1 1 1 1 1 1 3 3 1 2 1 1 1 1 1 1 2 2 1 3 3 2 3 1 1 1 3 1 3 3
##  [38] 2 3 1 1 3 1 1 1 1 1 1 2 3 1 3 3 1 2 1 1 1 3 1 2 1 1 2 3 1 3 3 3 2 1 1 1 1
##  [75] 3 1 3 1 1 3 1 1 3 1 1 1 3 3 1 3 1 3 1 2 1 1 3 2 1 1 3 2 1 1 1 2 2 3 3 2 3
## [112] 3 1 1 1 3 3 1 3 3 1 3 1 3 1 1 1 1 3 2 3 1 1 3 3 3 1 2 1 1 2 1 3 3 1 3 1 1
## [149] 2 3 3 3 1 1 1 1 3 3 1 1 3 1 1 1 1 1 2 3 2 2 1 3 2 3 3 3 2 1 3 1 3 3 2 3 2
## [186] 1 2 3 3 3 3 3 1 2 2 1 3 3 2 1 1 1 1 3 1 1 1 1 1 1 3 3 2 2 1 1 1 2 1 1 3 3
## [223] 1 3 3 3 1 3 3 2 1 1 3 2 2 2 3 1 1 3 2 3 3 2 3 3 1 2 1 2 3 2 3 3 1 1 1 1 2
## [260] 1 3 1 3 1 2 3 1 3 1 1 1 1 2 2 3 3 3 3 2 3 1 2 3 2 1 3 3 1 1 1 3 1 1 2 3 2
## [297] 1 1 2 2
mod_taxForFuture <- lm(taxForFuture ~ condition*pol, data = gjg)
summary(mod_taxForFuture)
## 
## Call:
## lm(formula = taxForFuture ~ condition * pol, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4642 -1.0075  0.3201  0.9925  3.6943 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    1.445085   0.434820   3.323    0.001 ** 
## conditionassuredSuccess        0.527714   0.632273   0.835    0.405    
## conditionuncertainSuccess      0.597195   0.624262   0.957    0.340    
## pol                            0.682365   0.088476   7.712 1.93e-13 ***
## conditionassuredSuccess:pol   -0.009923   0.127407  -0.078    0.938    
## conditionuncertainSuccess:pol -0.050668   0.126289  -0.401    0.689    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.557 on 294 degrees of freedom
## Multiple R-squared:  0.3657, Adjusted R-squared:  0.3549 
## F-statistic:  33.9 on 5 and 294 DF,  p-value: < 2.2e-16
mod_ataxForFuture <- lm(taxForFuture ~ condition, data = gjg_aRef)
summary(mod_ataxForFuture)
## 
## Call:
## lm(formula = taxForFuture ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.1400 -1.1400  0.4286  1.4286  2.4286 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.1400     0.1931  26.623   <2e-16 ***
## conditioncontrol           -0.5686     0.2744  -2.072   0.0391 *  
## conditionuncertainSuccess  -0.1498     0.2717  -0.551   0.5818    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.931 on 297 degrees of freedom
## Multiple R-squared:  0.01527,    Adjusted R-squared:  0.008639 
## F-statistic: 2.303 on 2 and 297 DF,  p-value: 0.1018
mod_renewableElectric <- lm(renewableElectric ~ condition*pol, data = gjg)
summary(mod_renewableElectric)
## 
## Call:
## lm(formula = renewableElectric ~ condition * pol, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4609 -1.2868  0.2757  1.1781  3.6091 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    1.95715    0.44432   4.405 1.48e-05 ***
## conditionassuredSuccess        0.20200    0.64609   0.313    0.755    
## conditionuncertainSuccess      0.11086    0.63790   0.174    0.862    
## pol                            0.58396    0.09041   6.459 4.35e-10 ***
## conditionassuredSuccess:pol    0.03193    0.13019   0.245    0.806    
## conditionuncertainSuccess:pol  0.02541    0.12905   0.197    0.844    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.591 on 294 degrees of freedom
## Multiple R-squared:  0.3105, Adjusted R-squared:  0.2988 
## F-statistic: 26.48 on 5 and 294 DF,  p-value: < 2.2e-16
mod_arenewableElectric <- lm(renewableElectric ~ condition, data = gjg_aRef)
summary(mod_arenewableElectric)
## 
## Call:
## lm(formula = renewableElectric ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.0600 -1.0600  0.3673  1.3673  2.3673 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.0600     0.1899  26.651   <2e-16 ***
## conditioncontrol           -0.4273     0.2699  -1.584    0.114    
## conditionuncertainSuccess  -0.1482     0.2672  -0.555    0.579    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.899 on 297 degrees of freedom
## Multiple R-squared:  0.00862,    Adjusted R-squared:  0.001944 
## F-statistic: 1.291 on 2 and 297 DF,  p-value: 0.2765
# Fit regression model
mod_clicked <- glm(clicked ~ condition, data = gjg, family = binomial)
summary(mod_clicked)
## 
## Call:
## glm(formula = clicked ~ condition, family = binomial, data = gjg)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4828  -0.4828  -0.4543  -0.4389   2.1853  
## 
## Coefficients:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)               -2.29141    0.34978  -6.551 5.72e-11 ***
## conditionassuredSuccess    0.20067    0.47381   0.424    0.672    
## conditionuncertainSuccess  0.07221    0.48293   0.150    0.881    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 195.05  on 299  degrees of freedom
## Residual deviance: 194.86  on 297  degrees of freedom
## AIC: 200.86
## 
## Number of Fisher Scoring iterations: 5
mod_aclicked <- glm(clicked ~ condition, data = gjg_aRef, family = binomial)
summary(mod_aclicked)
## 
## Call:
## glm(formula = clicked ~ condition, family = binomial, data = gjg_aRef)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4828  -0.4828  -0.4543  -0.4389   2.1853  
## 
## Coefficients:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                -2.0907     0.3196  -6.542 6.08e-11 ***
## conditioncontrol           -0.2007     0.4738  -0.424    0.672    
## conditionuncertainSuccess  -0.1285     0.4615  -0.278    0.781    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 195.05  on 299  degrees of freedom
## Residual deviance: 194.86  on 297  degrees of freedom
## AIC: 200.86
## 
## Number of Fisher Scoring iterations: 5

8 Perception of Past Generations Outcomes

percep_plot_list <- list(plot_cooker(gjg, condition, lifestylePG),
                         plot_cooker(gjg, condition, thankfulPG),
                         plot_cooker(gjg, condition, sacrificesPG),
                         plot_cooker(gjg, condition, gratitudePG)                         )

percep_plot_arranged <- ggarrange(plotlist = percep_plot_list, ncol = 2, nrow = 2)
plot_grid(percep_plot_arranged, ncol = 1, rel_heights = c(0.1, 0.9))

pol_line(gjg, pol, lifestylePG)

pol_line(gjg, pol, thankfulPG)

pol_line(gjg, pol, sacrificesPG)

pol_line(gjg, pol, gratitudePG)

mod_lifestylePG <- lm(lifestylePG ~ condition, data = gjg)
summary(mod_lifestylePG)
## 
## Call:
## lm(formula = lifestylePG ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.9804 -0.9804  0.2300  1.2300  3.3061 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.6939     0.1580  23.381  < 2e-16 ***
## conditionassuredSuccess     1.0761     0.2223   4.841 2.08e-06 ***
## conditionuncertainSuccess   1.2865     0.2212   5.815 1.56e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.564 on 297 degrees of freedom
## Multiple R-squared:  0.1151, Adjusted R-squared:  0.1091 
## F-statistic: 19.31 on 2 and 297 DF,  p-value: 1.302e-08
mod_alifestylePG <- lm(lifestylePG ~ condition, data = gjg_aRef)
summary(mod_alifestylePG)
## 
## Call:
## lm(formula = lifestylePG ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.9804 -0.9804  0.2300  1.2300  3.3061 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 4.7700     0.1564  30.499  < 2e-16 ***
## conditioncontrol           -1.0761     0.2223  -4.841 2.08e-06 ***
## conditionuncertainSuccess   0.2104     0.2201   0.956     0.34    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.564 on 297 degrees of freedom
## Multiple R-squared:  0.1151, Adjusted R-squared:  0.1091 
## F-statistic: 19.31 on 2 and 297 DF,  p-value: 1.302e-08
mod_thankfulPG <- lm(thankfulPG ~ condition, data = gjg)
summary(mod_thankfulPG)
## 
## Call:
## lm(formula = thankfulPG ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4300 -0.6373  0.3627  0.8776  2.8776 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 4.1224     0.1427  28.891  < 2e-16 ***
## conditionassuredSuccess     1.3076     0.2008   6.512 3.16e-10 ***
## conditionuncertainSuccess   1.5148     0.1998   7.581 4.40e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.413 on 297 degrees of freedom
## Multiple R-squared:  0.1842, Adjusted R-squared:  0.1787 
## F-statistic: 33.52 on 2 and 297 DF,  p-value: 7.477e-14
mod_athankfulPG <- lm(thankfulPG ~ condition, data = gjg_aRef)
summary(mod_athankfulPG)
## 
## Call:
## lm(formula = thankfulPG ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4300 -0.6373  0.3627  0.8776  2.8776 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.4300     0.1413  38.441  < 2e-16 ***
## conditioncontrol           -1.3076     0.2008  -6.512 3.16e-10 ***
## conditionuncertainSuccess   0.2073     0.1988   1.043    0.298    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.413 on 297 degrees of freedom
## Multiple R-squared:  0.1842, Adjusted R-squared:  0.1787 
## F-statistic: 33.52 on 2 and 297 DF,  p-value: 7.477e-14
mod_thankfulPG <- lm(sacrificesPG ~ condition, data = gjg)
summary(mod_thankfulPG)
## 
## Call:
## lm(formula = sacrificesPG ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.1300 -0.7551 -0.1300  0.8700  3.2449 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.7551     0.1361  27.594  < 2e-16 ***
## conditionassuredSuccess     1.3749     0.1915   7.180 5.62e-12 ***
## conditionuncertainSuccess   1.6076     0.1906   8.437 1.45e-15 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.347 on 297 degrees of freedom
## Multiple R-squared:  0.2174, Adjusted R-squared:  0.2121 
## F-statistic: 41.25 on 2 and 297 DF,  p-value: < 2.2e-16
mod_asacrificesPG <- lm(sacrificesPG ~ condition, data = gjg_aRef)
summary(mod_asacrificesPG)
## 
## Call:
## lm(formula = sacrificesPG ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.1300 -0.7551 -0.1300  0.8700  3.2449 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.1300     0.1347  38.080  < 2e-16 ***
## conditioncontrol           -1.3749     0.1915  -7.180 5.62e-12 ***
## conditionuncertainSuccess   0.2327     0.1896   1.228    0.221    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.347 on 297 degrees of freedom
## Multiple R-squared:  0.2174, Adjusted R-squared:  0.2121 
## F-statistic: 41.25 on 2 and 297 DF,  p-value: < 2.2e-16
mod_gratitudePG <- lm(gratitudePG ~ condition, data = gjg)
summary(mod_gratitudePG)
## 
## Call:
## lm(formula = gratitudePG ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7549 -0.7549  0.2451  0.9082  1.9082 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.0918     0.1097  28.184  < 2e-16 ***
## conditionassuredSuccess     0.6482     0.1544   4.199 3.55e-05 ***
## conditionuncertainSuccess   0.6631     0.1536   4.316 2.16e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.086 on 297 degrees of freedom
## Multiple R-squared:  0.07495,    Adjusted R-squared:  0.06872 
## F-statistic: 12.03 on 2 and 297 DF,  p-value: 9.454e-06
mod_agratitudePG <- lm(gratitudePG ~ condition, data = gjg_aRef)
summary(mod_agratitudePG)
## 
## Call:
## lm(formula = gratitudePG ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7549 -0.7549  0.2451  0.9082  1.9082 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.7400     0.1086  34.438  < 2e-16 ***
## conditioncontrol           -0.6482     0.1544  -4.199 3.55e-05 ***
## conditionuncertainSuccess   0.0149     0.1528   0.098    0.922    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.086 on 297 degrees of freedom
## Multiple R-squared:  0.07495,    Adjusted R-squared:  0.06872 
## F-statistic: 12.03 on 2 and 297 DF,  p-value: 9.454e-06

9 Intentions towards future generations

percep_plot_list <- list(plot_cooker(gjg, condition, futureImpact),
                         plot_cooker(gjg, condition, futureSacrifice),
                         plot_cooker(gjg, condition, futureObligation),
                         plot_cooker(gjg, condition, futureResponsibility))

percep_plot_arranged <- ggarrange(plotlist = percep_plot_list, ncol = 2, nrow = 2)

plot_grid(percep_plot_arranged, ncol = 1, rel_heights = c(0.1, 0.9))

pol_line(gjg, pol, futureImpact)

pol_line(gjg, pol, futureSacrifice)

pol_line(gjg, pol, futureObligation)

pol_line(gjg, pol, futureResponsibility)

mod_futureImpact <- lm(futureImpact ~ condition + pol, data = gjg)
summary(mod_futureImpact)
## 
## Call:
## lm(formula = futureImpact ~ condition + pol, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.0231 -0.5328  0.2139  0.8232  2.3155 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.92650    0.24853  15.799  < 2e-16 ***
## conditionassuredSuccess    0.22257    0.19280   1.154   0.2493    
## conditionuncertainSuccess  0.32417    0.19181   1.690   0.0921 .  
## pol                        0.26771    0.04527   5.914 9.19e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.356 on 296 degrees of freedom
## Multiple R-squared:  0.1151, Adjusted R-squared:  0.1061 
## F-statistic: 12.83 on 3 and 296 DF,  p-value: 6.665e-08
mod_afutureImpact <- lm(futureImpact ~ condition, data = gjg_aRef)
summary(mod_afutureImpact)
## 
## Call:
## lm(formula = futureImpact ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.5000 -0.5000  0.5000  0.8469  1.8469 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.4100     0.1431  37.799   <2e-16 ***
## conditioncontrol           -0.2569     0.2034  -1.263    0.208    
## conditionuncertainSuccess   0.0900     0.2014   0.447    0.655    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.431 on 297 degrees of freedom
## Multiple R-squared:  0.01048,    Adjusted R-squared:  0.003815 
## F-statistic: 1.573 on 2 and 297 DF,  p-value: 0.2092
mod_futureSacrifice <- lm(futureSacrifice ~ condition + pol, data = gjg)
summary(mod_futureSacrifice)
## 
## Call:
## lm(formula = futureSacrifice ~ condition + pol, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.7686 -0.5159  0.2420  0.7763  2.4947 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.74038    0.23906  15.646  < 2e-16 ***
## conditionassuredSuccess    0.25961    0.18545   1.400   0.1626    
## conditionuncertainSuccess  0.47271    0.18450   2.562   0.0109 *  
## pol                        0.25266    0.04354   5.803 1.68e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.304 on 296 degrees of freedom
## Multiple R-squared:  0.1214, Adjusted R-squared:  0.1125 
## F-statistic: 13.64 on 3 and 296 DF,  p-value: 2.343e-08
mod_afutureSacrifice <- lm(futureSacrifice ~ condition, data = gjg_aRef)
summary(mod_afutureSacrifice)
## 
## Call:
## lm(formula = futureSacrifice ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.3922 -0.3922  0.1020  0.8100  2.1020 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.1900     0.1374  37.773   <2e-16 ***
## conditioncontrol           -0.2920     0.1953  -1.495    0.136    
## conditionuncertainSuccess   0.2022     0.1934   1.046    0.297    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.374 on 297 degrees of freedom
## Multiple R-squared:  0.02149,    Adjusted R-squared:  0.0149 
## F-statistic: 3.261 on 2 and 297 DF,  p-value: 0.03972
mod_futureObligation <- lm(futureObligation ~ condition + pol, data = gjg)
summary(mod_futureObligation)
## 
## Call:
## lm(formula = futureObligation ~ condition + pol, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.0081 -0.5405  0.2610  0.9919  1.7992 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                4.83251    0.24235  19.940  < 2e-16 ***
## conditionassuredSuccess    0.23375    0.18800   1.243  0.21473    
## conditionuncertainSuccess  0.30428    0.18704   1.627  0.10484    
## pol                        0.13455    0.04414   3.048  0.00251 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.322 on 296 degrees of freedom
## Multiple R-squared:  0.04037,    Adjusted R-squared:  0.03064 
## F-statistic: 4.151 on 3 and 296 DF,  p-value: 0.006674
mod_afutureObligation <- lm(futureObligation ~ condition, data = gjg_aRef)
summary(mod_afutureObligation)
## 
## Call:
## lm(formula = futureObligation ~ condition, data = gjg_aRef)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -4.765 -0.700  0.300  1.235  1.551 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                5.70000    0.13404  42.525   <2e-16 ***
## conditioncontrol          -0.25102    0.19052  -1.318    0.189    
## conditionuncertainSuccess  0.06471    0.18863   0.343    0.732    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.34 on 297 degrees of freedom
## Multiple R-squared:  0.01024,    Adjusted R-squared:  0.003578 
## F-statistic: 1.537 on 2 and 297 DF,  p-value: 0.2168
mod_futureResponsibility <- lm(futureResponsibility ~ condition + pol, data = gjg)
summary(mod_futureResponsibility)
## 
## Call:
## lm(formula = futureResponsibility ~ condition + pol, data = gjg)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.81264 -0.63122  0.05207  0.69376  1.97915 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.35609    0.18713  12.590  < 2e-16 ***
## conditionassuredSuccess    0.34804    0.14517   2.397 0.017129 *  
## conditionuncertainSuccess  0.48333    0.14443   3.347 0.000924 ***
## pol                        0.15836    0.03408   4.646 5.09e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.021 on 296 degrees of freedom
## Multiple R-squared:  0.1038, Adjusted R-squared:  0.09468 
## F-statistic: 11.42 on 3 and 296 DF,  p-value: 4.143e-07
mod_afutureResponsibility <- lm(futureResponsibility ~ condition, data = gjg_aRef)
summary(mod_afutureResponsibility)
## 
## Call:
## lm(formula = futureResponsibility ~ condition, data = gjg_aRef)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.57843 -0.57843 -0.08163  0.55000  1.91837 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.4500     0.1056  32.682   <2e-16 ***
## conditioncontrol           -0.3684     0.1500  -2.455   0.0147 *  
## conditionuncertainSuccess   0.1284     0.1486   0.865   0.3880    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.056 on 297 degrees of freedom
## Multiple R-squared:  0.0384, Adjusted R-squared:  0.03193 
## F-statistic:  5.93 on 2 and 297 DF,  p-value: 0.002983

10 Moral to Try

percep_plot_list <- list(plot_cooker(gjg, condition, moralMitigate),
                         plot_cooker(gjg, condition, moralProtect),
                         plot_cooker(gjg, condition, moralCollective))

percep_plot_arranged <- ggarrange(plotlist = percep_plot_list, ncol = 2, nrow = 2)


plot_grid(percep_plot_arranged, ncol = 1, rel_heights = c(0.1, 0.9))

pol_line(gjg, pol, moralMitigate)

pol_line(gjg, pol, moralProtect)

pol_line(gjg, pol, moralCollective)

mod_moralMitigate <- lm(moralMitigate ~ condition, data = gjg)
summary(mod_moralMitigate)
## 
## Call:
## lm(formula = moralMitigate ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.7549 -1.2143  0.2451  1.2451  2.7857 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 4.2143     0.1606  26.248   <2e-16 ***
## conditionassuredSuccess     0.3057     0.2259   1.353   0.1770    
## conditionuncertainSuccess   0.5406     0.2248   2.405   0.0168 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.589 on 297 degrees of freedom
## Multiple R-squared:  0.01917,    Adjusted R-squared:  0.01257 
## F-statistic: 2.903 on 2 and 297 DF,  p-value: 0.05642
mod_amoralMitigate <- lm(moralMitigate ~ condition, data = gjg_aRef)
summary(mod_amoralMitigate)
## 
## Call:
## lm(formula = moralMitigate ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.7549 -1.2143  0.2451  1.2451  2.7857 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 4.5200     0.1589  28.437   <2e-16 ***
## conditioncontrol           -0.3057     0.2259  -1.353    0.177    
## conditionuncertainSuccess   0.2349     0.2237   1.050    0.294    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.589 on 297 degrees of freedom
## Multiple R-squared:  0.01917,    Adjusted R-squared:  0.01257 
## F-statistic: 2.903 on 2 and 297 DF,  p-value: 0.05642
mod_moralProtect <- lm(moralProtect ~ condition, data = gjg)
summary(mod_moralProtect)
## 
## Call:
## lm(formula = moralProtect ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7347 -1.5490  0.2653  1.3300  3.4510 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.73469    0.15755  23.705   <2e-16 ***
## conditionassuredSuccess   -0.06469    0.22169  -0.292    0.771    
## conditionuncertainSuccess -0.18567    0.22061  -0.842    0.401    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.56 on 297 degrees of freedom
## Multiple R-squared:  0.002462,   Adjusted R-squared:  -0.004255 
## F-statistic: 0.3665 on 2 and 297 DF,  p-value: 0.6935
mod_amoralProtect <- lm(moralProtect ~ condition, data = gjg_aRef)
summary(mod_amoralProtect)
## 
## Call:
## lm(formula = moralProtect ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7347 -1.5490  0.2653  1.3300  3.4510 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.67000    0.15597  23.531   <2e-16 ***
## conditioncontrol           0.06469    0.22169   0.292    0.771    
## conditionuncertainSuccess -0.12098    0.21949  -0.551    0.582    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.56 on 297 degrees of freedom
## Multiple R-squared:  0.002462,   Adjusted R-squared:  -0.004255 
## F-statistic: 0.3665 on 2 and 297 DF,  p-value: 0.6935
mod_moralCollective <- lm(moralCollective ~ condition, data = gjg)
summary(mod_moralCollective)
## 
## Call:
## lm(formula = moralCollective ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4902 -0.4902  0.5098  1.0000  2.0000 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.0000     0.1556   32.13   <2e-16 ***
## conditionassuredSuccess     0.3700     0.2190    1.69   0.0921 .  
## conditionuncertainSuccess   0.4902     0.2179    2.25   0.0252 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.54 on 297 degrees of freedom
## Multiple R-squared:  0.01807,    Adjusted R-squared:  0.01146 
## F-statistic: 2.733 on 2 and 297 DF,  p-value: 0.06668
mod_amoralCollective <- lm(moralCollective ~ condition, data = gjg_aRef)
summary(mod_amoralCollective)
## 
## Call:
## lm(formula = moralCollective ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4902 -0.4902  0.5098  1.0000  2.0000 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.3700     0.1540  34.859   <2e-16 ***
## conditioncontrol           -0.3700     0.2190  -1.690   0.0921 .  
## conditionuncertainSuccess   0.1202     0.2168   0.554   0.5797    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.54 on 297 degrees of freedom
## Multiple R-squared:  0.01807,    Adjusted R-squared:  0.01146 
## F-statistic: 2.733 on 2 and 297 DF,  p-value: 0.06668

11 Efficacy

percep_plot_list <- list(plot_cooker(gjg, condition, effortEfficacy),
                         plot_cooker(gjg, condition, dayToDayEfficacyR),
                         plot_cooker(gjg, condition, americansEfficacy1),
                         plot_cooker(gjg, condition, americansEfficacy2))

percep_plot_arranged <- ggarrange(plotlist = percep_plot_list, ncol = 2, nrow = 2)

plot_grid(percep_plot_arranged, ncol = 1, rel_heights = c(0.1, 0.9))

mod_effortEfficacy <- lm(effortEfficacy ~ condition, data = gjg)
summary(mod_effortEfficacy)
## 
## Call:
## lm(formula = effortEfficacy ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.0196 -0.8600  0.1400  0.9804  2.2755 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.7245     0.1093  24.932   <2e-16 ***
## conditionassuredSuccess     0.1355     0.1538   0.881   0.3789    
## conditionuncertainSuccess   0.2951     0.1530   1.929   0.0547 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.082 on 297 degrees of freedom
## Multiple R-squared:  0.01241,    Adjusted R-squared:  0.005761 
## F-statistic: 1.866 on 2 and 297 DF,  p-value: 0.1565
mod_aeffortEfficacy <- lm(effortEfficacy ~ condition, data = gjg_aRef)
summary(mod_aeffortEfficacy)
## 
## Call:
## lm(formula = effortEfficacy ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.0196 -0.8600  0.1400  0.9804  2.2755 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.8600     0.1082  26.438   <2e-16 ***
## conditioncontrol           -0.1355     0.1538  -0.881    0.379    
## conditionuncertainSuccess   0.1596     0.1522   1.048    0.295    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.082 on 297 degrees of freedom
## Multiple R-squared:  0.01241,    Adjusted R-squared:  0.005761 
## F-statistic: 1.866 on 2 and 297 DF,  p-value: 0.1565
mod_dayToDayEfficacyR <- lm(dayToDayEfficacyR ~ condition, data = gjg)
summary(mod_dayToDayEfficacyR)
## 
## Call:
## lm(formula = dayToDayEfficacyR ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.5306 -1.2843 -0.2843  0.7157  2.7157 
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.5306122  0.1204211  21.015   <2e-16 ***
## conditionassuredSuccess   -0.0006122  0.1694475  -0.004    0.997    
## conditionuncertainSuccess -0.2462985  0.1686233  -1.461    0.145    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.192 on 297 degrees of freedom
## Multiple R-squared:  0.009559,   Adjusted R-squared:  0.00289 
## F-statistic: 1.433 on 2 and 297 DF,  p-value: 0.2402
mod_adayToDayEfficacyR <- lm(dayToDayEfficacyR ~ condition, data = gjg_aRef)
summary(mod_adayToDayEfficacyR)
## 
## Call:
## lm(formula = dayToDayEfficacyR ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.5306 -1.2843 -0.2843  0.7157  2.7157 
## 
## Coefficients:
##                             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                2.5300000  0.1192108  21.223   <2e-16 ***
## conditioncontrol           0.0006122  0.1694475   0.004    0.997    
## conditionuncertainSuccess -0.2456863  0.1677611  -1.465    0.144    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.192 on 297 degrees of freedom
## Multiple R-squared:  0.009559,   Adjusted R-squared:  0.00289 
## F-statistic: 1.433 on 2 and 297 DF,  p-value: 0.2402
mod_americansEfficacy1 <- lm(americansEfficacy1 ~ condition, data = gjg)
summary(mod_americansEfficacy1)
## 
## Call:
## lm(formula = americansEfficacy1 ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.4216 -0.9898  0.0102  0.9500  2.0102 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.9898     0.1122  26.640  < 2e-16 ***
## conditionassuredSuccess     0.0602     0.1579   0.381  0.70331    
## conditionuncertainSuccess   0.4318     0.1572   2.747  0.00637 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.111 on 297 degrees of freedom
## Multiple R-squared:  0.02919,    Adjusted R-squared:  0.02266 
## F-statistic: 4.466 on 2 and 297 DF,  p-value: 0.01228
mod_aamericansEfficacy1 <- lm(americansEfficacy1 ~ condition, data = gjg_aRef)
summary(mod_aamericansEfficacy1)
## 
## Call:
## lm(formula = americansEfficacy1 ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.4216 -0.9898  0.0102  0.9500  2.0102 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.0500     0.1111  27.452   <2e-16 ***
## conditioncontrol           -0.0602     0.1579  -0.381   0.7033    
## conditionuncertainSuccess   0.3716     0.1563   2.377   0.0181 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.111 on 297 degrees of freedom
## Multiple R-squared:  0.02919,    Adjusted R-squared:  0.02266 
## F-statistic: 4.466 on 2 and 297 DF,  p-value: 0.01228
mod_americansEfficacy2 <- lm(americansEfficacy2 ~ condition, data = gjg)
summary(mod_americansEfficacy2)
## 
## Call:
## lm(formula = americansEfficacy2 ~ condition, data = gjg)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.277 -1.051 -0.140  0.860  1.949 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.05102    0.11610  26.279   <2e-16 ***
## conditionassuredSuccess    0.08898    0.16337   0.545    0.586    
## conditionuncertainSuccess  0.22621    0.16297   1.388    0.166    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.149 on 296 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.006579,   Adjusted R-squared:  -0.0001334 
## F-statistic: 0.9801 on 2 and 296 DF,  p-value: 0.3765
mod_aamericansEfficacy2 <- lm(americansEfficacy2 ~ condition, data = gjg_aRef)
summary(mod_aamericansEfficacy2)
## 
## Call:
## lm(formula = americansEfficacy2 ~ condition, data = gjg_aRef)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.277 -1.051 -0.140  0.860  1.949 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                3.14000    0.11494  27.320   <2e-16 ***
## conditioncontrol          -0.08898    0.16337  -0.545    0.586    
## conditionuncertainSuccess  0.13723    0.16214   0.846    0.398    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.149 on 296 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.006579,   Adjusted R-squared:  -0.0001334 
## F-statistic: 0.9801 on 2 and 296 DF,  p-value: 0.3765

12 Hope

percep_plot_list <- list(plot_cooker(gjg, condition, optimism),
                         plot_cooker(gjg, condition, hope))

percep_plot_arranged <- ggarrange(plotlist = percep_plot_list, ncol = 2, nrow = 1)

plot_grid(percep_plot_arranged, ncol = 1, rel_heights = c(0.1, 0.9))

pol_line(gjg, pol, optimism)

pol_line(gjg, pol, hope)

mod_optimism <- lm(optimism ~ condition, data = gjg)
summary(mod_optimism)
## 
## Call:
## lm(formula = optimism ~ condition, data = gjg)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.730 -1.143  0.270  1.270  2.857 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 4.1429     0.1647  25.158   <2e-16 ***
## conditionassuredSuccess     0.5871     0.2317   2.534   0.0118 *  
## conditionuncertainSuccess   0.5532     0.2306   2.399   0.0170 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.63 on 297 degrees of freedom
## Multiple R-squared:  0.02652,    Adjusted R-squared:  0.01996 
## F-statistic: 4.045 on 2 and 297 DF,  p-value: 0.01849
mod_aoptimism <- lm(optimism ~ condition, data = gjg_aRef)
summary(mod_aoptimism)
## 
## Call:
## lm(formula = optimism ~ condition, data = gjg_aRef)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -3.730 -1.143  0.270  1.270  2.857 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                4.73000    0.16302  29.015   <2e-16 ***
## conditioncontrol          -0.58714    0.23172  -2.534   0.0118 *  
## conditionuncertainSuccess -0.03392    0.22941  -0.148   0.8826    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.63 on 297 degrees of freedom
## Multiple R-squared:  0.02652,    Adjusted R-squared:  0.01996 
## F-statistic: 4.045 on 2 and 297 DF,  p-value: 0.01849
mod_hope <- lm(hope ~ condition, data = gjg)
summary(mod_hope)
## 
## Call:
## lm(formula = hope ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7157 -0.7157  0.2843  0.6939  1.6939 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.3061     0.1191  27.770   <2e-16 ***
## conditionassuredSuccess     0.1739     0.1675   1.038   0.3001    
## conditionuncertainSuccess   0.4096     0.1667   2.457   0.0146 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.179 on 297 degrees of freedom
## Multiple R-squared:  0.02011,    Adjusted R-squared:  0.01351 
## F-statistic: 3.047 on 2 and 297 DF,  p-value: 0.04897
mod_ahope <- lm(hope ~ condition, data = gjg_aRef)
summary(mod_ahope)
## 
## Call:
## lm(formula = hope ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.7157 -0.7157  0.2843  0.6939  1.6939 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.4800     0.1179  29.528   <2e-16 ***
## conditioncontrol           -0.1739     0.1675  -1.038    0.300    
## conditionuncertainSuccess   0.2357     0.1659   1.421    0.156    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.179 on 297 degrees of freedom
## Multiple R-squared:  0.02011,    Adjusted R-squared:  0.01351 
## F-statistic: 3.047 on 2 and 297 DF,  p-value: 0.04897

13 Superordinate Identity

percep_plot_list <- list(plot_cooker(gjg, condition, intergenerational1),
                         plot_cooker(gjg, condition, intergenerational2),
                         plot_cooker(gjg, condition, american1),
                         plot_cooker(gjg, condition, american2))

percep_plot_arranged <- ggarrange(plotlist = percep_plot_list, ncol = 2, nrow = 2)

plot_grid(percep_plot_arranged, ncol = 1, rel_heights = c(0.1, 0.9))

pol_line(gjg, pol, intergenerational1)

pol_line(gjg, pol, intergenerational2)

pol_line(gjg, pol, american1)

pol_line(gjg, pol, american2)

mod_intergenerational1 <- lm(intergenerational1 ~ condition, data = gjg)
summary(mod_taxForFuture)
## 
## Call:
## lm(formula = taxForFuture ~ condition * pol, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.4642 -1.0075  0.3201  0.9925  3.6943 
## 
## Coefficients:
##                                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    1.445085   0.434820   3.323    0.001 ** 
## conditionassuredSuccess        0.527714   0.632273   0.835    0.405    
## conditionuncertainSuccess      0.597195   0.624262   0.957    0.340    
## pol                            0.682365   0.088476   7.712 1.93e-13 ***
## conditionassuredSuccess:pol   -0.009923   0.127407  -0.078    0.938    
## conditionuncertainSuccess:pol -0.050668   0.126289  -0.401    0.689    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.557 on 294 degrees of freedom
## Multiple R-squared:  0.3657, Adjusted R-squared:  0.3549 
## F-statistic:  33.9 on 5 and 294 DF,  p-value: < 2.2e-16
mod_aintergenerational1 <- lm(intergenerational1 ~ condition, data = gjg_aRef)
summary(mod_ataxForFuture)
## 
## Call:
## lm(formula = taxForFuture ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.1400 -1.1400  0.4286  1.4286  2.4286 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 5.1400     0.1931  26.623   <2e-16 ***
## conditioncontrol           -0.5686     0.2744  -2.072   0.0391 *  
## conditionuncertainSuccess  -0.1498     0.2717  -0.551   0.5818    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.931 on 297 degrees of freedom
## Multiple R-squared:  0.01527,    Adjusted R-squared:  0.008639 
## F-statistic: 2.303 on 2 and 297 DF,  p-value: 0.1018
mod_intergenerational2 <- lm(intergenerational2 ~ condition, data = gjg)
summary(mod_intergenerational2)
## 
## Call:
## lm(formula = intergenerational2 ~ condition, data = gjg)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.294 -0.949 -0.170  0.830  2.051 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 2.9490     0.1166  25.281   <2e-16 ***
## conditionassuredSuccess     0.2210     0.1641   1.347   0.1791    
## conditionuncertainSuccess   0.3451     0.1633   2.113   0.0354 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.155 on 297 degrees of freedom
## Multiple R-squared:  0.01514,    Adjusted R-squared:  0.008509 
## F-statistic: 2.283 on 2 and 297 DF,  p-value: 0.1038
mod_aintergenerational2 <- lm(intergenerational2 ~ condition, data = gjg_aRef)
summary(mod_aintergenerational2)
## 
## Call:
## lm(formula = intergenerational2 ~ condition, data = gjg_aRef)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -2.294 -0.949 -0.170  0.830  2.051 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 3.1700     0.1155  27.452   <2e-16 ***
## conditioncontrol           -0.2210     0.1641  -1.347    0.179    
## conditionuncertainSuccess   0.1241     0.1625   0.764    0.446    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.155 on 297 degrees of freedom
## Multiple R-squared:  0.01514,    Adjusted R-squared:  0.008509 
## F-statistic: 2.283 on 2 and 297 DF,  p-value: 0.1038
mod_american1 <- lm(american1 ~ condition, data = gjg)
summary(mod_american1)
## 
## Call:
## lm(formula = american1 ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.9608 -0.8571  0.1000  1.0392  1.1429 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                5.85714    0.12390  47.272   <2e-16 ***
## conditionassuredSuccess    0.04286    0.17435   0.246    0.806    
## conditionuncertainSuccess  0.10364    0.17350   0.597    0.551    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.227 on 297 degrees of freedom
## Multiple R-squared:  0.001215,   Adjusted R-squared:  -0.005511 
## F-statistic: 0.1806 on 2 and 297 DF,  p-value: 0.8348
mod_aamerican1 <- lm(american1 ~ condition, data = gjg_aRef)
summary(mod_aamerican1)
## 
## Call:
## lm(formula = american1 ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.9608 -0.8571  0.1000  1.0392  1.1429 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                5.90000    0.12266  48.101   <2e-16 ***
## conditioncontrol          -0.04286    0.17435  -0.246    0.806    
## conditionuncertainSuccess  0.06078    0.17261   0.352    0.725    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.227 on 297 degrees of freedom
## Multiple R-squared:  0.001215,   Adjusted R-squared:  -0.005511 
## F-statistic: 0.1806 on 2 and 297 DF,  p-value: 0.8348
mod_american2 <- lm(american2 ~ condition, data = gjg)
summary(mod_american2)
## 
## Call:
## lm(formula = american2 ~ condition, data = gjg)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.8300 -0.8300  0.2449  1.1863  2.2449 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                4.75510    0.17659  26.927   <2e-16 ***
## conditionassuredSuccess    0.07490    0.24849   0.301    0.763    
## conditionuncertainSuccess  0.05862    0.24728   0.237    0.813    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.748 on 297 degrees of freedom
## Multiple R-squared:  0.0003378,  Adjusted R-squared:  -0.006394 
## F-statistic: 0.05019 on 2 and 297 DF,  p-value: 0.9511
mod_aamerican2 <- lm(american2 ~ condition, data = gjg_aRef)
summary(mod_aamerican2)
## 
## Call:
## lm(formula = american2 ~ condition, data = gjg_aRef)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.8300 -0.8300  0.2449  1.1863  2.2449 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                4.83000    0.17482  27.628   <2e-16 ***
## conditioncontrol          -0.07490    0.24849  -0.301    0.763    
## conditionuncertainSuccess -0.01627    0.24602  -0.066    0.947    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.748 on 297 degrees of freedom
## Multiple R-squared:  0.0003378,  Adjusted R-squared:  -0.006394 
## F-statistic: 0.05019 on 2 and 297 DF,  p-value: 0.9511