## Load packages
pacman::p_load(DT, estimatr, kableExtra, readr, reshape2, tidyverse, xtable, dataMaid, ggcorrplot, ggmap, rpart, rpart.plot, pollster, wordcloud, tm, RColorBrewer, hrbrthemes, janitor, purrr, gridExtra, cowplot, rcompanion, nnet, texreg, compareGroups, factoextra, cluster, fastDummies, simputation, sentimentr, politeness, textir, here, ggtext)

set.seed(94305)

# discrete colorblind palette
cb_colors <- brewer.pal(n = 8, name = "Dark2")

# custom ggplot2 theme
custom_theme <- theme_minimal() + 
      theme(strip.text = element_text(size = 16),
        axis.text=element_text(size=16),
        axis.title=element_text(size=16,face="bold"),
        panel.spacing = unit(1, "lines"), 
        legend.title = element_text(size=16,face="bold"), 
        legend.text = element_text(size=16), 
        plot.title = element_text(size = 20, face = "bold"), 
        plot.title.position = "plot", 
        plot.subtitle = element_markdown(size = 16), 
        plot.caption = element_text(size = 16))
df <- read.csv(here::here("pilot_analysis", "cleaned_data", "clean_complete_v7.csv"))

df_full <- read.csv(here("pilot_analysis","cleaned_data", "clean_full_v7.csv"))
ads <- read.csv(here("pilot_analysis","cleaned_data", "clean_ads_v7.csv"))

df <- df %>% 
  left_join(ads, by = "original_ref")

best_treatment_heuristics <- read.csv(here("pilot_analysis", "heuristics", "free_text_v7_categories - best_treatment_explain.csv"))

belief_main_heuristics <- read.csv(here("pilot_analysis", "heuristics", "free_text_vaxstatus_v7.xlsx - belief_main_other.csv"))

motive_main_heuristics <- read.csv(here("pilot_analysis","heuristics", "free_text_vaxstatus_v7.xlsx - motive_main_other.csv"))

risk_main_heuristics <- read.csv(here("pilot_analysis","heuristics", "free_text_vaxstatus_v7.xlsx - risk_main_other.csv"))

benefit_main_heuristics <- read.csv(here("pilot_analysis","heuristics", "free_text_vaxstatus_v7.xlsx - benefit_main_other.csv"))


clean_text <- function(column){
  str_squish(gsub("[[:punct:]]", " ", tolower(column)))
  
}

# bring in heuristic levels
df <- df %>%
  mutate(across(c(best_treatment_explain, 
                  belief_main_other,
                  benefit_main_other,
                  motive_main_other, 
                  risk_main_other), clean_text)) %>%
  merge(best_treatment_heuristics, 
        by.x = c("best_treatment", "best_treatment_explain"), 
        by.y  = c("best_treatment.selected","best_treatment_explain"), all.x = T) %>%
  mutate(best_treatment_gl = gsub(" ", "_", clean_text(General.Level)))%>%
  select(!General.Level) %>%
  merge(belief_main_heuristics, by = c("vax_status", "belief_main_other"), all.x = T) %>%
  mutate(belief_gl = gsub(" ", "_", clean_text(General.Level))) %>% 
  select(!General.Level) %>%
  merge(motive_main_heuristics, by = c("vax_status", "motive_main_other"), all.x = T) %>%
  mutate(motive_gl = gsub(" ", "_", clean_text(General.Level))) %>%
  select(!General.Level)%>%
  merge(risk_main_heuristics[, c("vax_status", "risk_main_other", "General.Level")], 
        by.x = c("vax_status", "risk_main_other"), 
        by.y = c("vax_status", "risk_main_other"), all.x = T) %>%
  mutate(risk_gl = gsub(" ", "_", clean_text(General.Level))) %>%
  select(!General.Level)%>%
  merge(benefit_main_heuristics[, c("vax_status", "benefit_main_other", "General.Level")], 
        by.x = c("vax_status", "benefit_main_other"), 
        by.y = c("vax_status", "benefit_main_other"), all.x = T) %>%
  mutate(benefit_gl = gsub(" ", "_", clean_text(General.Level))) %>%
  select(!General.Level)

1 Introduction

1.1 Script Overview

What’s new: In this version, we include free text categories of motive impediments as predictors of best treatment.

Motivation: We want to predict what types of treatments will work for users, without explicitly asking them. Predicting these proxy treatments helps us understand:

  1. If our chatbot is capturing enough information to predict treatments without explicitly asking.

  2. Which features hold more predictive power. We will emphasize capturing those features through the chatbot in a future wave.

Implementation: We use supervised machine learning models (MLM and Random Forest) to see if we can predict the best treatment from features collected in the chatbot.

Sample: This script analyzes data collected in pilot 7 (2362 respondents with complete information).

Important Links: This script expands on Saurabh’s user segmentation script. The related GitHub issue is here.

1.2 Project Overview

Background

COVID-19 vaccine hesitancy has been recognized as a problem across nations. A resistance to getting vaccinated is emerging as a major hurdle, especially in the developing world, where vaccine access issues are still being gradually resolved. Persistent pools of unvaccinated people around the world could present a greater risk for the emergence of new variants of concern. Addressing people’s vaccine hesitancy is hence crucial to curb the spread of COVID-19, and to consequently avert hospitalizations and death.

Objectives

We intend to understand why people are hesitant about getting the COVID-19 vaccine. Hesitancy could not only occur within the unvaccinated population but also in a subset of people who already got vaccinated. Therefore, the first phase of our project has the following objectives:

  1. Understand why people are hesitant to get the COVID-19 vaccines
  2. Understand ways to best elicit vaccine impediments from respondents
  3. Pinpoint what treatments will help people get vaccinated

Approach

We intend to use chatbot as a medium (on Facebook) to conduct conversations with people and understand how we can best achieve the above three objectives. We have run six pilots as of March 2022 – 2 in the United States using Lucid, and 5 in South Africa on Facebook. Our eventual goal will be running this using an interactive, personalized chatbot that enables the conversation to flow more naturally than in a survey format. We are running the pilots in order to – 1) achieve technical proofs of concept, 2) reduce participant recruitment & completion costs (survey completion of unvaccinated participants open to treatment ) before experiment launch, 3) improve chatbot script/forking/engagement before experiment launch, and 4) gather exploratory ideas for impactful covariates and treatments. Our insights from these pilots are detailed ahead.

2 Feature cleaning for models

We start by cleaning and filtering our data frames to features we expect to be useful for modeling. We consider the following 4 sets of features:

  • Feature set 1 (Impediments):
    • Motivation impediments: against_beliefs (vaccine is against my beliefs), no_benefits (vaccine has no benefits), risky (vaccine is risky). These are coded as binary (0/1).
    • Ability impediments: no_time (no time to get vaxxed), no_money (no money to get vaxxed), no_availability (vaccine not easily available). These are coded as binary (0/1).
  • Feature set 2 (Ads):
    • Ad theme: ad_theme_risky (vaccine is risky) and ad_theme_unnecessary (vaccine is not necessary). These are coded as binary (0/1).
    • Ad text: ad_text_airtime is a binary (0/1) indicating whether the ad text explicitly mentions that respondents will receive mobile airtime.
  • Feature set 3 (Free text):
    • elaboration: The average number of characters typed by a respondent across all free text questions faced. We normalize this variable before clustering.
    • politeness: Politeness score calculated across all free text typed by a respondent. This ranges from 0 to 104 in our sample (based on number of politeness attributes touched) and is constructed using Mike Yeomans’ politeness package. We normalize this variable before running the clustering algorithm. Higher score means more polite text.
    • receptivity: Receptivity score is a continuous score calculated across all free text typed by a respondent. This is also constructed using Mike Yeomans’ politeness package. We normalize it before running the clustering algorithm. Higher score means more receptive text.
    • sentiment: Sentiment polarity (range -1 to 1) for all free text typed by a respondent.
  • Feature set 4 (Demographics):
    • age: Participant age in years
    • female: 1 if female, 0 if male
    • income: 0 if the participant is unemployed, 1 if household income < R5,000, 2 if household income in R5,000 – R9,999, …, 6 if household income > R100,000
    • education: 1 if the participant’s education < high school, 2 if education is high school, …, 6 if education is a graduate degree
    • religiosity: 1 if the participant is not very religious, 2 if somewhat religious, 3 if very religious
    • politics: 1 if the participant is conservative, 2 if moderate, 3 if liberal
    • location: 1 if the participant lives in rural, 2 if suburban, 3 if urban,
    • white: 1 if the participant is a white or caucasian, 0 if not
  • Feature set 5 (Free text Categories):
    • motive_gl: the hand classified general level category for users who chose “other” in the motive_main_other variable and provided a free text response
    • benefit_gl: the hand classified general level category for users who chose “other” in the benefit_main variable and provided a free text response
    • belief_gl: the hand classified general level category for users who chose “other” in the belief_main variable and provided a free text response
    • risk_gl: the hand classified general level category for users who chose “other” in the risk_main variable and provided a free text response

All continuous variables are normalized before clustering.

Since we can’t feed missing values to a clustering algorithm, we impute any missingness in demographic variables using a linear imputation model building on values from female, white, and age.

df_sentiment <-
  df %>% 
  select(contains(c("_other", "_explain"))) %>% 
  unite("text", 1:50, na.rm = T, remove = T, sep = ". ") %>%
  pull(text) %>%
  get_sentences() %>%
  sentiment_by() %>% 
  bind_cols(df %>% select(chatfuel_user_id)) %>% 
  transmute(chatfuel_user_id, sentiment = ave_sentiment)

# politeness and receptivity
df_politeness <-
  df %>% 
  select(contains(c("_other", "_explain"))) %>% 
  unite("text", 1:50, na.rm = T, remove = T, sep = ". ") %>%
  select(text) %>%
  mutate(politeness = rowSums(politeness::politeness(text, parser = "spacy")),
         receptivity = politeness::receptiveness(text))%>% 
  select(!text) %>%
  bind_cols(df %>% select(chatfuel_user_id)) 


df_elaboration <-
  df %>%
  filter(age <= 120) %>% 
  select(ends_with(c("_other", "_explain"))) %>% 
  mutate_all(~ nchar(.)) %>% 
  transmute(
    elaboration =
      pmap_dbl(
        .,
        ~ mean(c(...), na.rm = TRUE)
      )
  )
df_ad_features <-
  df %>% 
  filter( age <= 120) %>%
  transmute(
    chatfuel_user_id,
    # ad_image = `Analysis 2 - image`,
    ad_theme = Analysis.3...impediment.theme, 
    belief_gl, 
    motive_gl, 
    best_treatment_gl,
    risk_gl,
    benefit_gl
    #ad_text = `Analysis 4 - body text`
  ) %>%
  fastDummies::dummy_cols(
    select_columns = c("ad_theme", "belief_gl", 
                       "risk_gl", "motive_gl", "benefit_gl"),
    remove_first_dummy = TRUE,
    remove_selected_columns = TRUE, ignore_na = TRUE
  ) %>% 
  fastDummies::dummy_cols(
    select_columns = c("best_treatment_gl"), remove_first_dummy = TRUE,
    remove_selected_columns = FALSE, ignore_na = TRUE
  ) %>% 
  #mutate(ad_text_airtime = if_else(ad_text == "airtime", 1L, 0L) %>% replace_na(0)) %>% 
  select(chatfuel_user_id, starts_with(c("ad_text_", "ad_theme_")), contains(c("_gl"))) %>% 
  mutate_at(vars(starts_with("ad_theme"), contains("gl"), -"best_treatment_gl"), ~ replace_na(., 0)) %>% 
  bind_cols(df_elaboration) %>% 
  left_join(df_politeness, by = "chatfuel_user_id") %>% 
  left_join(df_sentiment, by = "chatfuel_user_id") %>% 
  distinct(chatfuel_user_id, .keep_all = T)


df_features_raw <-
  df %>% 
  transmute(
   # best_treatment,
    chatfuel_user_id,
    age,
    vax_status = ifelse(vax_status == "vax", 1, 0),
    female = case_when(
      gender == "female" ~ 1,
      gender == "male" ~ 0,
    ),
    income = case_when(
      income == "Unemployed" ~ 0,
      income == "< R5,000" ~ 1,
      income == "R5,000 – R9,999" ~ 2,
      income == "R10,000 – R29,999" ~ 3,
      income == "R30,000 – R49,999" ~ 4,
      income == "R50,000 – R99,999" ~ 5,
      income == "> R100,000" ~ 6,
    ),
    education = case_when(
      education == "< high school" ~ 1,
      education == "high school" ~ 2,
      education == "some college" ~ 3,
      education == "2-year degree" ~ 4,
      education == "4-year degree" ~ 5,
      education == "graduate degree" ~ 6,
    ),
    religiosity = case_when(
      religiosity == "not very religious" ~ 1,
      religiosity == "somewhat religious" ~ 2,
      religiosity == "very religious" ~ 3,
    ),
    politics = case_when(
      politics == "conservative" ~ 1,
      politics == "moderate" ~ 2,
      politics == "liberal" ~ 3,
    ),
    location = case_when(
      location == "rural" ~ 1,
      location == "suburban" ~ 2,
      location == "urban" ~ 3,
    ),
    white = case_when(
      ethnicity == "white or caucasian" ~ 1,
      ethnicity != "white or caucasian" ~ 0
    ),
    against_beliefs = if_else(motive_main == "belief", 1L, 0L) %>% replace_na(0),
    no_benefits = if_else(motive_main == "benefit", 1L, 0L) %>% replace_na(0),
    risky = if_else(motive_main == "risk", 1L, 0L) %>% replace_na(0),
    no_time = if_else(ability_main == "time", 1L, 0L) %>% replace_na(0),
    no_money = if_else(ability_main == "money", 1L, 0L) %>% replace_na(0),
    no_availability = if_else(ability_main == "availability", 1L, 0L) %>% replace_na(0),
  ) %>%
  distinct(chatfuel_user_id, .keep_all = T) %>% 
  left_join(df_ad_features, by = "chatfuel_user_id") %>% 
  impute_lm(politics + income + religiosity + location + education ~ female + white + age) %>% 
  #drop_na() %>% 
  mutate_at(vars(age, elaboration, sentiment, politeness, receptivity
                 ), ~ scale(.) %>% as.vector()) %>% 
  relocate(chatfuel_user_id)

df_features <- df_features_raw %>% select(-chatfuel_user_id)

Here are summary statistics for the features fed into the algorithm:

df_features %>%
  select(against_beliefs, no_benefits, risky, no_time, no_money, no_availability, #ad_theme_risky,
         ad_theme_unnecessary, #ad_theme_inaccessible, 
         ad_theme_neutral, ad_theme_innocence = `ad_theme_innocence/curiosity`, ad_theme_fear, ad_theme_familyvalues, elaboration, politeness, receptivity,
         contains(c("gl")), 
         sentiment, age, female, income, education, religiosity, politics, location, white, vax_status, everything()) %>%
  clean_names(case = "title") %>%
  papeR::summarize_numeric() %>% 
  datatable(options = list(pageLength = 10, columnDefs = list(list(orderable = TRUE, targets = 0))))

2.0.1 Best Treatment Summary

Below, we show the percent of participants selecting each best treatment category.

df %>%
  select(best_treatment) %>%
  group_by(best_treatment) %>%
  count() %>%
  ungroup() %>%
  mutate(percent_of_total_obs = round(n/sum(n)*100, 2),
         n_nonmissing = sum(n[!is.na(best_treatment)]),
         percent_of_nonmissing_obs = ifelse(!is.na(best_treatment), round(n/n_nonmissing*100, 2), NA)) %>%
  select(best_treatment, n, percent_of_nonmissing_obs, percent_of_total_obs) %>%
  arrange(desc(percent_of_nonmissing_obs))  %>% 
  datatable(options = list(pageLength = 20, columnDefs = list(list(orderable = TRUE, targets = 0))))

2.0.2 Free Text Summaries

We hand categorize the free text responses from the following variables: motive_main_other, benefit_main_other, belief_main_other, and risk_main_other. These categories are implemented in our model as binary variables, where a 1 indicates that the participant included a free text response in the category, and 0 indicates that the participant did not include a free text response in the category, either because i) their free text response is included in a different category or ii) the respondent never saw the free text question.

For an example of the latter, say a participant chose “belief” as their main motive impediment. Then, they would never see risk_main_other. Also, if they chose a multiple choice answer for their more specific belief impediment, such as “religious reasons”, they would never see belief_main_other.

Below, we show the frequencies of these free text categories.

2.0.2.1 Motive Main Other

df %>%
  select(motive_gl) %>%
  group_by(motive_gl) %>%
  count() %>%
  ungroup() %>%
  mutate(percent_of_total_obs = round(n/sum(n)*100, 2),
         n_nonmissing = sum(n[!is.na(motive_gl)]),
         percent_of_nonmissing_obs = ifelse(!is.na(motive_gl), round(n/n_nonmissing*100, 2), NA)) %>%
  select(motive_gl, n, percent_of_nonmissing_obs, percent_of_total_obs) %>%
  arrange(desc(percent_of_nonmissing_obs))  %>% 
  datatable(options = list(pageLength = 20, columnDefs = list(list(orderable = TRUE, targets = 0))))

2.0.2.2 Benefit Main Other

df %>%
  select(benefit_gl) %>%
  group_by(benefit_gl) %>%
  count() %>%
  ungroup() %>%
  mutate(percent_of_total_obs = round(n/sum(n)*100, 2),
         n_nonmissing = sum(n[!is.na(benefit_gl)]),
         percent_of_nonmissing_obs = ifelse(!is.na(benefit_gl), round(n/n_nonmissing*100, 2), NA)) %>%
  select(benefit_gl, n, percent_of_nonmissing_obs, percent_of_total_obs) %>%
  arrange(desc(percent_of_nonmissing_obs))  %>% 
  datatable(options = list(pageLength = 20, columnDefs = list(list(orderable = TRUE, targets = 0))))

2.0.2.3 Belief Main Other

df %>%
  select(belief_gl) %>%
  group_by(belief_gl) %>%
  count() %>%
  ungroup() %>%
  mutate(percent_of_total_obs = round(n/sum(n)*100, 2),
         n_nonmissing = sum(n[!is.na(belief_gl)]),
         percent_of_nonmissing_obs = ifelse(!is.na(belief_gl), round(n/n_nonmissing*100, 2), NA)) %>%
  select(belief_gl, n, percent_of_nonmissing_obs, percent_of_total_obs) %>%
  arrange(desc(percent_of_nonmissing_obs))  %>% 
  datatable(options = list(pageLength = 20, columnDefs = list(list(orderable = TRUE, targets = 0))))

2.0.2.4 Risk Main Other

df %>%
  select(risk_gl) %>%
  group_by(risk_gl) %>%
  count() %>%
  ungroup() %>%
  mutate(percent_of_total_obs = round(n/sum(n)*100, 2),
         n_nonmissing = sum(n[!is.na(risk_gl)]),
         percent_of_nonmissing_obs = ifelse(!is.na(risk_gl), round(n/n_nonmissing*100, 2), NA)) %>%
  select(risk_gl, n, percent_of_nonmissing_obs, percent_of_total_obs) %>%
  arrange(desc(percent_of_nonmissing_obs))  %>% 
  datatable(options = list(pageLength = 20, columnDefs = list(list(orderable = TRUE, targets = 0))))

3 Supervised models

Let’s move ahead and look at two supervised learning approaches to inform user segments – multinomial logit and random forest. The task here is to try and predict – i) motivation impediments, and ii) preferred treatments, using all available chatbot features.

3.1 Best Treatment

df_mlm <-
  df_features_raw %>%
  inner_join(
    df %>%
      transmute(
        chatfuel_user_id,
        best_treatment = str_to_sentence(best_treatment),
        best_treatment = if_else(best_treatment %in% c("Family supports it", "Trusted info source", "More transparency", "Nothing", "Rewards for vaxxing", "Job/school required", "Other", "Something else"), best_treatment, NA_character_) %>%
      as_factor()) %>%
      distinct(chatfuel_user_id, .keep_all = T),
    by = c("chatfuel_user_id")
  ) %>%
  select(-c(chatfuel_user_id, contains(c("best_treatment_gl"))))


df_mlm$best_treatment <- relevel(df_mlm$best_treatment, ref = "Nothing")

trainingRows <- sample(1:nrow(df_mlm), 0.7 * nrow(df_mlm))
training <- df_mlm[trainingRows, ]
test <- df_mlm[-trainingRows, ]


cols = c("against_beliefs", "no_benefits", "risky", colnames(training)[grepl(colnames(training), pattern= "motive_gl")])



for (c in 1:length(cols)){
  
  model_cols <- cols[1:c]
  
  formula <- as.formula(paste("best_treatment ~ ", paste(model_cols,collapse = " + ")))
  
  mlm1 <-
    multinom(formula, data = training, trace = F)
  
  coef(mlm1)%>% 
    kable(format = "html") %>% 
    kable_styling() %>%
    print()
  
  predicted_class <- predict(mlm1, test)
  
  table(`Predicted class` = predicted_class, `True class` = test$best_treatment) %>%
    kable(format = "html") %>%
    kable_styling() %>%
    add_header_above(c("Predicted\nclass" = 1, "True class" =  7)) %>% print()
  
  print("misclassification error: ")
  mean(as.character(predicted_class) != as.character(test$best_treatment), na.rm = T) %>% print()

}
(Intercept) against_beliefs
Job/school required 0.7723622 -0.6922875
Family supports it 0.0145851 -1.8064244
Trusted info source -0.3111326 -1.5859374
Something else -1.2151433 -1.7809585
Rewards for vaxxing -1.4986888 -0.8037783
Other -3.2117725 -0.8817773
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 0 0 0 0 0 0
Job/school required 147 275 133 88 26 31 6
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6104816
(Intercept) against_beliefs no_benefits
Job/school required 0.7799824 -0.6999490 -0.0304213
Family supports it 0.1749285 -1.9667589 -0.8826384
Trusted info source -0.1764699 -1.7207039 -0.6903367
Something else -1.1592083 -1.8362579 -0.2417596
Rewards for vaxxing -1.5337965 -0.7688200 0.1329300
Other -3.3721335 -0.7217837 0.5231936
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 0 0 0 0 0 0
Job/school required 147 275 133 88 26 31 6
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6104816
(Intercept) against_beliefs no_benefits risky
Job/school required 0.8703693 -0.7903159 -0.1208202 -0.2236268
Family supports it 0.5345852 -2.3265041 -1.2422821 -1.2051600
Trusted info source 0.0746403 -1.9717362 -0.9413717 -0.7232521
Something else -0.7833651 -2.2118601 -0.6174550 -1.2960263
Rewards for vaxxing -1.8633940 -0.4389812 0.4625860 0.6442515
Other -3.1442121 -0.9506292 0.2964861 -0.6401798
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 0 0 0 0 0 0
Job/school required 147 275 133 88 26 31 6
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6104816
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs
Job/school required 0.8621696 -0.780826 -0.0750920 -0.2034179 -0.5451625
Family supports it 0.5645228 -2.339567 -1.2278318 -1.1709885 -14.1945556
Trusted info source 0.1102563 -2.241895 -1.0040790 -0.7391879 -14.2526499
Something else -0.7260202 -2.252958 -0.6304148 -1.2892707 -13.7879050
Rewards for vaxxing -1.7869812 -0.498799 0.4305616 0.5519212 -13.1719354
Other -3.0681590 -1.008617 0.2650143 -0.6515694 -9.3186689
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 0 0 0 0 0 0
Job/school required 141 261 130 84 23 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6127596
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit
Job/school required 0.8542955 -0.7729649 -0.0672241 -0.1955863 -0.5386329 11.367742
Family supports it 0.5592141 -2.3342543 -1.2225292 -1.1657084 -15.6796719 10.969735
Trusted info source 0.1102588 -2.2419199 -1.0040689 -0.7392041 -15.8691448 -5.243318
Something else -0.7652063 -2.2137750 -0.5912391 -1.2500971 -15.4328727 12.987377
Rewards for vaxxing -1.7869012 -0.4988211 0.4304844 0.5518272 -14.8444868 -2.616233
Other -3.0678589 -1.0092613 0.2647290 -0.6523810 -10.5158675 -1.087051
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 0 0 0 0 0 0
Job/school required 140 260 130 84 23 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 1 1 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6142433
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence
Job/school required 0.8761828 -0.7948568 -0.0891080 -0.2173660 -0.5571991 11.588572 -0.8762196
Family supports it 0.5917619 -2.3668246 -1.2550729 -1.1981675 -16.1807167 11.179863 -1.9781908
Trusted info source 0.1481266 -2.2797845 -1.0419247 -0.7769774 -16.4179132 -5.486366 -15.4112529
Something else -0.7273263 -2.2515034 -0.6291066 -1.2878825 -15.9201415 13.192108 -14.7822807
Rewards for vaxxing -1.7489264 -0.5368490 0.3924883 0.5139184 -15.2658480 -2.711525 -14.7163839
Other -3.0299614 -1.0466892 0.2268806 -0.6903533 -10.9146331 -1.168340 -11.3021794
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 1 1 0 1 0 0
Job/school required 140 259 129 84 22 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 1 1 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.615727
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates
Job/school required 0.8700935 -0.7887876 -0.0830333 -0.2143875 -0.551479 11.900503 -0.870124 11.925664
Family supports it 0.5917566 -2.3667719 -1.2550591 -1.1981785 -16.534847 11.485668 -1.978216 -5.732912
Trusted info source 0.1481233 -2.2797664 -1.0419255 -0.7769764 -16.835055 -5.666500 -15.813336 -5.366723
Something else -0.7454529 -2.2334644 -0.6109465 -1.2789927 -16.290923 13.515983 -15.165252 13.024015
Rewards for vaxxing -1.7824400 -0.5033201 0.4259939 0.5303243 -15.530481 -2.745471 -14.997504 13.644830
Other -3.0298638 -1.0470089 0.2267592 -0.6905497 -11.152615 -1.236064 -11.597172 -1.078981
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 1 1 0 1 0 0
Job/school required 141 260 129 84 22 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6142433
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation
Job/school required 0.8583857 -0.7770448 -0.0730393 -0.2042254 -0.5410743 12.075071 -0.8584983 12.152710 0.5495011
Family supports it 0.5720914 -2.3470672 -1.2382693 -1.1810482 -16.7678934 11.668130 -1.9582929 -5.870275 0.8013042
Trusted info source 0.1567431 -2.2883646 -1.0493056 -0.7845785 -17.0824560 -5.806439 -16.1022958 -5.514434 -0.7482351
Something else -0.7481622 -2.2308052 -0.6086963 -1.2766862 -16.4741128 13.681471 -15.4215544 13.244412 0.1564343
Rewards for vaxxing -1.7662933 -0.5195101 0.4122002 0.5162976 -15.6917507 -2.780917 -15.2052938 13.852549 -12.8024346
Other -3.0133601 -1.0642724 0.2123291 -0.7050178 -11.2979887 -1.235577 -11.7748782 -1.087235 -12.4960779
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 1 1 0 1 0 0
Job/school required 141 260 129 84 22 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6142433
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason
Job/school required 0.8553385 -0.7744816 -0.0699878 -0.2012100 -0.5386681 12.348952 -0.8553532 12.519397 0.5526571 0.0664060
Family supports it 0.5958437 -2.3671077 -1.2618973 -1.2047131 -17.3062379 11.915360 -1.9822377 -6.155191 0.7800602 -0.7399334
Trusted info source 0.1943876 -2.3201608 -1.0868991 -0.8221918 -17.6863520 -6.095470 -16.7082513 -5.794445 -0.7818563 -1.7251951
Something else -0.7022756 -2.2694696 -0.6544668 -1.3220920 -17.0663959 13.906716 -16.0382054 13.567444 0.1151790 -14.2846232
Rewards for vaxxing -1.7761138 -0.5112354 0.4220404 0.5260271 -16.0449076 -2.792530 -15.5976888 14.222585 -13.1046808 0.2007767
Other -2.9674587 -1.1025472 0.1664643 -0.7505739 -11.7618173 -1.278577 -12.2875085 -1.131245 -12.9096471 -14.4667527
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 1 1 0 1 0 0
Job/school required 140 259 129 84 22 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 1 1 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.615727
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical
Job/school required 0.8733146 -0.7923490 -0.0879198 -0.2191034 -0.5539366 12.097861 -0.8733001 12.332973 0.5379052 0.0496814 -0.8734548
Family supports it 0.6213437 -2.3924228 -1.2873083 -1.2301259 -17.2040375 11.657376 -2.0077013 -6.229759 0.7580660 -0.7643090 -1.7203395
Trusted info source 0.2085153 -2.3341882 -1.1009744 -0.8362479 -17.5902574 -6.131574 -16.6926421 -5.828826 -0.7930861 -1.7382388 -0.6141138
Something else -0.6711203 -2.3005718 -0.6855245 -1.3530841 -16.9362950 13.643606 -15.9963099 13.369416 0.0880926 -14.2162842 -15.4435515
Rewards for vaxxing -1.7450749 -0.5420361 0.3910186 0.4951153 -15.8534534 -2.767267 -15.4889352 14.026870 -12.9287440 0.1718843 -14.7130964
Other -2.9361986 -1.1337861 0.1352931 -0.7817856 -11.5984959 -1.269052 -12.1871150 -1.129263 -12.7280922 -14.3713178 -11.3393655
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 1 0 0 0 0 1 0
Job/school required 139 260 130 84 23 29 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 1 1 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6127596
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested
Job/school required 0.8733110 -0.7923453 -0.0879130 -0.2190911 -0.5538715 12.080634 -0.8732853 12.324787 0.5378774 0.0496896 -0.8734345 -4.0242629
Family supports it 0.6156391 -2.3867391 -1.2816243 -1.2244368 -17.1693926 11.645863 -2.0020155 -6.252395 0.7633431 -0.7586445 -1.7146238 13.8038158
Trusted info source 0.2085170 -2.3341842 -1.1009771 -0.8362402 -17.5765628 -6.149647 -16.6918804 -5.848559 -0.7932310 -1.7382351 -0.6141189 -2.9087314
Something else -0.6711240 -2.3005538 -0.6855154 -1.3530824 -16.9113769 13.626398 -15.9915000 13.361243 0.0879404 -14.2075968 -15.4287698 -1.6168840
Rewards for vaxxing -1.7450859 -0.5420323 0.3910272 0.4951293 -15.8113415 -2.765706 -15.4613019 14.018710 -12.8861563 0.1719096 -14.6783006 -0.6504267
Other -2.9362426 -1.1335726 0.1353583 -0.7817009 -11.5596283 -1.275746 -12.1640961 -1.136929 -12.6960299 -14.3692432 -11.3109248 -0.2305628
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 1 0 0 0 0 1 0
Job/school required 139 260 130 84 23 29 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 1 1 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6127596
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs
Job/school required 0.8857482 -0.8046923 -0.1003336 -0.2314961 -0.5643284 12.201152 -0.8857295 12.518343 0.5274952 0.0381068 -0.8856772 -4.1269429 -0.8860912
Family supports it 0.6312443 -2.4022212 -1.2972238 -1.2400171 -17.5034551 11.763035 -2.0174824 -6.454839 0.7498910 -0.7735050 -1.7297946 14.0486828 -1.3249966
Trusted info source 0.2298773 -2.3554979 -1.1223171 -0.8575892 -17.9528300 -6.311868 -17.0677202 -6.017573 -0.8119868 -1.7586849 -0.6352566 -2.9781516 -17.5458687
Something else -0.6497848 -2.3219957 -0.7068195 -1.3743410 -17.2621099 13.737665 -16.3654699 13.547215 0.0692000 -14.4871393 -15.7661385 -1.6478031 -16.8599779
Rewards for vaxxing -1.7238247 -0.5631650 0.3697814 0.4739404 -16.0832264 -2.813595 -15.7825561 14.206224 -13.0695047 0.1521785 -14.9610475 -0.6598495 -14.8767697
Other -2.9148773 -1.1552929 0.1140212 -0.8030269 -11.7192210 -1.319934 -12.3935828 -1.183242 -12.9269519 -14.7302010 -11.5084281 -0.2409025 -9.9030520
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 0 2 0 0 0 0 0
Job/school required 140 258 130 84 23 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 1 1 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6172107
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs motive_gl_personal_health
Job/school required 0.9303643 -0.8489857 -0.1448639 -0.2718267 -0.6033871 12.554437 -0.9303826 12.981889 0.4893754 -0.0038915 -0.9304775 -4.3336072 -0.9303828 -1.3177526
Family supports it 0.6816415 -2.4524616 -1.3475459 -1.2856864 -18.3289849 12.109895 -2.0678696 -6.811831 0.7059414 -0.8219910 -1.7805340 14.5531467 -1.3749611 -1.7244522
Trusted info source 0.2832765 -2.4087345 -1.1756840 -0.9060815 -18.8617870 -6.688424 -17.9289553 -6.364076 -0.8588032 -1.8105106 -0.6888968 -3.1461905 -18.4860759 -2.0294301
Something else -0.5880875 -2.3834107 -0.7683500 -1.4299444 -18.2090966 14.072713 -17.2487182 13.990877 0.0147245 -15.2108584 -16.6402911 -1.7413137 -17.8627933 -15.3794547
Rewards for vaxxing -1.7739748 -0.5134393 0.4200789 0.5189453 -16.7428795 -2.789186 -16.4786680 14.733807 -13.5859334 0.1998603 -15.5864954 -0.6334534 -15.4422692 0.6254274
Other -2.8533183 -1.2166886 0.0524309 -0.8586073 -12.3995064 -1.400214 -13.1160175 -1.252715 -13.7206553 -15.5610640 -12.2036657 -0.2515998 -10.5161868 -13.2746857
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 2 6 5 0 1 1 0
Job/school required 139 255 125 84 22 29 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6186944
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs motive_gl_personal_health motive_gl_personal_medical_beliefs
Job/school required 0.9436722 -0.8622292 -0.1567952 -0.2849910 -0.615039 12.089183 -0.9436659 12.620283 0.4782696 -0.0164415 -0.9436456 -4.2614252 -0.9440428 -1.3304832 -0.3734656
Family supports it 0.7195571 -2.4902442 -1.3814409 -1.3234681 -17.923416 11.620077 -2.1057685 -6.808379 0.6717506 -0.8593548 -1.8182740 14.1756318 -1.4133723 -1.7620859 -2.0499987
Trusted info source 0.3269391 -2.4523714 -1.2148703 -0.9496736 -18.457542 -6.618490 -17.6368978 -6.316988 -0.8979464 -1.8531130 -0.7323173 -3.1207436 -18.0836299 -2.0722515 -16.2108522
Something else -0.5647413 -2.4066801 -0.7893816 -1.4530017 -17.738338 13.597413 -16.9511865 13.615702 -0.0055432 -15.0078787 -16.3376922 -1.7077075 -17.3690708 -15.2276339 -0.7811536
Rewards for vaxxing -1.8562951 -0.4318411 0.4934595 0.5999581 -15.944362 -2.536427 -15.7722087 14.434249 -12.9653068 0.2780384 -14.8413504 -0.5643659 -14.4701733 0.6984642 1.1185130
Other -2.8093598 -1.2612295 0.0128024 -0.9030106 -12.060285 -1.364067 -12.8095148 -1.227726 -13.2482723 -15.0942887 -11.9262058 -0.2445652 -10.2852240 -12.9989751 -13.6627128
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 1 5 5 0 1 0 0
Job/school required 140 256 125 84 22 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6186944
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs motive_gl_personal_health motive_gl_personal_medical_beliefs motive_gl_risky
Job/school required 0.9822805 -0.9005243 -0.1934033 -0.3217166 -0.6477145 12.496521 -0.982341 13.040666 0.4466406 -0.0528348 -0.9822704 -4.3642824 -0.9828188 -1.3673884 -0.4099482 -0.5604247
Family supports it 0.7896544 -2.5600824 -1.4481316 -1.3905239 -18.5039628 11.996014 -2.175848 -6.975358 0.6100567 -0.9276191 -1.8884411 14.4659648 -1.4835967 -1.8317221 -2.1198151 -1.4269577
Trusted info source 0.3771487 -2.5023693 -1.2626841 -0.9977428 -19.0526498 -6.810662 -18.142328 -6.456830 -0.9405663 -1.9020537 -0.7828012 -3.2492931 -18.7245554 -2.1216469 -16.7542177 -0.7976868
Something else -0.5574654 -2.4140302 -0.7962506 -1.4597726 -18.3264240 14.036362 -17.418453 14.055974 -0.0080075 -15.5274033 -16.9026204 -1.7447878 -17.9966027 -15.6463101 -0.7888561 -0.0870384
Rewards for vaxxing -1.9798473 -0.3095548 0.6091600 0.7160356 -16.3144245 -2.405101 -16.021372 14.960932 -13.4930236 0.3941990 -15.1241037 -0.5143334 -14.7216872 0.8074586 1.2287151 0.9333099
Other -2.9248725 -1.1451358 0.1227084 -0.7921285 -12.1728803 -1.284469 -12.800999 -1.170000 -13.4532844 -15.0824872 -11.9852200 -0.2195478 -10.3833353 -13.0153816 -13.6984716 0.8611927
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 1 6 5 0 1 0 0
Job/school required 139 254 125 84 22 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 1 1 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6216617
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs motive_gl_personal_health motive_gl_personal_medical_beliefs motive_gl_risky motive_gl_scared
Job/school required 0.9532430 -0.8717201 -0.1647762 -0.2931079 -0.623404 12.348077 -0.9533261 13.075255 0.4696879 -0.0264579 -0.9531784 -4.3546527 -0.9536256 -1.341298 -0.3834033 -0.5339544 14.226815
Family supports it 0.7729869 -2.5434386 -1.4319226 -1.3744862 -18.204931 11.835209 -2.1593751 -7.096327 0.6222259 -0.9135622 -1.8717036 14.3699842 -1.4666886 -1.820397 -2.1076664 -1.4139907 13.713781
Trusted info source 0.3785939 -2.5039774 -1.2646267 -0.9997241 -18.929200 -6.865558 -18.0019082 -6.573244 -0.9459546 -1.9064494 -0.7841080 -3.2723514 -18.6226370 -2.127051 -16.5223165 -0.8022745 -5.776305
Something else -0.5563554 -2.4152138 -0.7975998 -1.4604820 -18.242832 13.857715 -17.3427755 14.049786 -0.0130776 -15.4907953 -16.8141930 -1.7554109 -17.9227172 -15.556352 -0.7928793 -0.0912593 -4.794503
Rewards for vaxxing -2.2841581 -0.0085464 0.9074107 1.0133898 -15.245763 -1.950002 -14.7311283 15.168012 -12.5490014 0.6755415 -13.7070185 -0.4042826 -12.9946117 1.074270 1.4988318 1.1996629 16.771185
Other -2.9238819 -1.1474277 0.1216251 -0.7936956 -11.834434 -1.291626 -12.5084759 -1.195866 -13.2093194 -14.8540724 -11.6956525 -0.2218726 -10.0469900 -12.790405 -13.4002829 0.8589842 -1.428094
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 1 6 5 0 1 0 0
Job/school required 139 254 125 84 22 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 1 1 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6216617
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs motive_gl_personal_health motive_gl_personal_medical_beliefs motive_gl_risky motive_gl_scared motive_gl_side_effects
Job/school required 0.9719391 -0.8887208 -0.1834917 -0.3117841 -0.6393507 12.037743 -0.9721634 12.925207 0.4554108 -0.0447548 -0.9719473 -4.3120365 -0.9721723 -1.360066 -0.4014945 -0.5518815 14.137392 -0.2413026
Family supports it 0.8331553 -2.5986997 -1.4920686 -1.4346057 -18.0967748 11.483386 -2.2193173 -7.240342 0.5692859 -0.9737652 -1.9316132 14.1569797 -1.5268403 -1.881504 -2.1682810 -1.4741491 13.583017 -1.1101577
Trusted info source 0.4329642 -2.5538381 -1.3189870 -1.0541212 -18.8026934 -6.942634 -18.0152988 -6.681801 -0.9919840 -1.9602132 -0.8382978 -3.2977133 -18.4819879 -2.181556 -16.5388722 -0.8561754 -5.924918 -0.9332548
Something else -0.4888399 -2.4773168 -0.8646521 -1.5271518 -18.0710337 13.498672 -17.3401651 13.845842 -0.0714296 -15.6140121 -16.8070616 -1.7847645 -17.7359667 -15.689670 -0.8593896 -0.1579516 -4.938906 -1.3982560
Rewards for vaxxing -2.4431660 0.1317397 1.0627496 1.1683523 -14.5001456 -1.676909 -13.8326773 15.125402 -12.0332871 0.8222144 -12.8047900 -0.3403723 -11.9860492 1.211471 1.6364872 1.3347820 16.859392 1.1818367
Other -2.8341733 -1.2289674 0.0326361 -0.8824342 -11.9263844 -1.264623 -12.6176738 -1.179922 -13.1126032 -14.7115913 -11.8224216 -0.2121825 -10.2471916 -12.844945 -13.3753454 0.7736499 -1.353651 -15.9592195
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 1 6 5 0 1 0 0
Job/school required 139 254 125 84 22 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 1 1 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6216617
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs motive_gl_personal_health motive_gl_personal_medical_beliefs motive_gl_risky motive_gl_scared motive_gl_side_effects motive_gl_social_media
Job/school required 0.9862109 -0.9027421 -0.1975958 -0.3258251 -0.6511594 14.443361 -0.9857301 15.647510 0.4443203 -0.0583888 -0.9862725 -5.1321138 -0.9866865 -1.373325 -0.4149187 -0.5653562 16.913712 -0.2552212 -25.137312
Family supports it 0.8475467 -2.6128058 -1.5062813 -1.4488252 -21.5258941 13.888827 -2.2339581 -8.551796 0.5577986 -0.9880777 -1.9464397 16.8897625 -1.5414324 -1.894712 -2.1826013 -1.4879225 16.359003 -1.1243277 -24.965930
Trusted info source 0.4472944 -2.5680408 -1.3331883 -1.0683190 -22.6301210 -8.226679 -21.5166718 -7.969402 -1.0032872 -1.9738048 -0.8529022 -3.9429117 -22.2543996 -2.195289 -19.5451185 -0.8699102 -6.828794 -0.9475171 -24.484827
Something else -0.4744844 -2.4915479 -0.8789794 -1.5413752 -21.9209449 15.903983 -20.9167253 16.567983 -0.0827003 -18.6238767 -20.2810284 -2.1331042 -21.5082511 -18.691122 -0.8735822 -0.1717453 -5.829826 -1.4118665 -21.694488
Rewards for vaxxing -2.4291708 0.1181769 1.0489271 1.1545532 -17.5524422 -2.003864 -16.7291266 17.847644 -14.5420991 0.8092733 -15.4852647 -0.4052172 -14.5082384 1.197737 1.6238585 1.3220761 19.636014 1.1685917 -10.606394
Other -2.8194271 -1.2439349 0.0179345 -0.8976189 -14.5387864 -1.607268 -15.3902266 -1.500130 -16.2208807 -18.1489676 -14.4295492 -0.2725134 -12.4522520 -15.664460 -16.4028179 0.7595618 -1.841228 -19.7448930 -7.953794
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 2 5 4 0 0 1 0
Job/school required 139 256 126 84 23 29 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6172107
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs motive_gl_personal_health motive_gl_personal_medical_beliefs motive_gl_risky motive_gl_scared motive_gl_side_effects motive_gl_social_media motive_gl_too_much_information
Job/school required 0.9826394 -0.8992237 -0.1940873 -0.3243163 -0.6478445 14.398407 -0.982174 15.679305 0.4476152 -0.0552171 -0.9826120 -5.1391998 -0.9830727 -1.369878 -0.4116818 -0.5620230 16.957864 -0.2520324 -25.022440 17.2048038
Family supports it 0.8477675 -2.6130797 -1.5065818 -1.4490823 -21.4603628 13.840071 -2.234166 -8.603621 0.5575387 -0.9887165 -1.9466240 16.8765534 -1.5415676 -1.895222 -2.1835622 -1.4885657 16.399350 -1.1250135 -24.860688 -7.4563635
Trusted info source 0.4475164 -2.5683222 -1.3334955 -1.0685778 -22.6099947 -8.247079 -21.503928 -8.016566 -1.0034760 -1.9744897 -0.8531384 -3.9456580 -22.2202433 -2.195755 -19.4918796 -0.8705034 -6.878881 -0.9482002 -24.367059 -6.6173731
Something else -0.4743018 -2.4918082 -0.8791968 -1.5415544 -21.9138975 15.855246 -20.935132 16.595305 -0.0828411 -18.6674318 -20.2843515 -2.1312339 -21.4744660 -18.719092 -0.8743046 -0.1722684 -5.877493 -1.4124784 -21.545184 -4.0775496
Rewards for vaxxing -2.4781103 0.1654876 1.0967388 1.1728464 -17.2304922 -1.955657 -16.382604 17.918052 -14.3133958 0.8536777 -15.1385867 -0.3962517 -14.1147501 1.244059 1.6665005 1.3661829 19.725550 1.2142442 -10.258039 19.9170714
Other -2.8192992 -1.2441690 0.0178108 -0.8977620 -14.4799390 -1.619399 -15.361663 -1.518440 -16.1871510 -18.1664109 -14.3914300 -0.2764140 -12.3863957 -15.668715 -16.3859905 0.7593839 -1.877217 -19.7839591 -7.900435 -0.8479648
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 1 5 4 0 0 0 0
Job/school required 140 256 126 84 23 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6186944
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs motive_gl_personal_health motive_gl_personal_medical_beliefs motive_gl_risky motive_gl_scared motive_gl_side_effects motive_gl_social_media motive_gl_too_much_information motive_gl_vaccinated
Job/school required 0.9663925 -0.8831861 -0.1779725 -0.3082487 -0.6340169 14.439180 -0.9658616 15.732935 0.4611771 -0.0399211 -0.9663793 -5.1362357 -0.9668708 -1.354408 -0.3963215 -0.5466836 16.992386 -0.2364244 -24.916353 17.2434490 15.5261717
Family supports it 0.8479996 -2.6133473 -1.5068254 -1.4493597 -21.4508731 13.864211 -2.2344252 -8.648793 0.5559844 -0.9895228 -1.9468198 16.8935561 -1.5418313 -1.895667 -2.1840774 -1.4890924 16.417389 -1.1255844 -24.783941 -7.4968783 -6.9727412
Trusted info source 0.4477610 -2.5686215 -1.3337946 -1.0688934 -22.6047568 -8.277191 -21.5180187 -8.061799 -1.0049416 -1.9752981 -0.8533665 -3.9641555 -22.1994079 -2.196160 -19.4852998 -0.8710212 -6.895644 -0.9487759 -24.284533 -6.6511786 -6.4008670
Something else -0.4979057 -2.4683527 -0.8557736 -1.5182132 -21.8025512 15.903088 -20.8671220 16.656512 -0.0619507 -18.6131482 -20.1961731 -2.1104593 -21.3351932 -18.707076 -0.8515134 -0.1494589 -5.876976 -1.3893629 -21.332151 -4.0476628 15.8915983
Rewards for vaxxing -2.4795910 0.1670776 1.0982997 1.1744834 -17.1650587 -1.970616 -16.3341412 17.963022 -14.2495250 0.8551686 -15.0882134 -0.4001644 -14.0546767 1.245740 1.6685166 1.3681522 19.745290 1.2156782 -10.215139 19.9481909 -1.0982116
Other -2.8191256 -1.2445182 0.0176454 -0.8979075 -14.4408486 -1.634939 -15.3434415 -1.534762 -16.1526009 -18.1849207 -14.3658015 -0.2804113 -12.3419757 -15.695404 -16.3760847 0.7590542 -1.899333 -19.8236677 -7.868344 -0.8562027 -0.7031036
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 1 5 4 0 0 0 0
Job/school required 140 256 126 84 23 30 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0
[1] “misclassification error:” [1] 0.6186944
(Intercept) against_beliefs no_benefits risky motive_gl_beliefs motive_gl_benefit motive_gl_community_stories_experiences_influence motive_gl_mandates motive_gl_misinformation motive_gl_no_reason motive_gl_nonsensical motive_gl_not_interested motive_gl_personal_beliefs motive_gl_personal_health motive_gl_personal_medical_beliefs motive_gl_risky motive_gl_scared motive_gl_side_effects motive_gl_social_media motive_gl_too_much_information motive_gl_vaccinated motive_gl_wants_vaccine
Job/school required 0.9609210 -0.8777844 -0.1725466 -0.3028431 -0.6293461 14.446983 -0.9603944 15.749297 0.4657656 -0.0347690 -0.9609114 -5.1374605 -0.9614073 -1.349213 -0.3911535 -0.5415194 17.010661 -0.2311699 -24.874292 17.2698202 15.5396268 16.7644701
Family supports it 0.8480765 -2.6134424 -1.5069073 -1.4494535 -21.4507800 13.866456 -2.2345015 -8.674796 0.5555172 -0.9897961 -1.9468958 16.9058267 -1.5419206 -1.895800 -2.1842484 -1.4892588 16.430109 -1.1257820 -24.762634 -7.5175863 -6.9856225 -4.9354799
Trusted info source 0.4478419 -2.5687235 -1.3338918 -1.0689994 -22.6158049 -8.294956 -21.5341929 -8.084124 -1.0053648 -1.9755678 -0.8534424 -3.9697963 -22.2016694 -2.196290 -19.4890160 -0.8711819 -6.919977 -0.9489754 -24.259417 -6.6681082 -6.4096797 -3.9942486
Something else -0.4978363 -2.4684509 -0.8558487 -1.5182863 -21.8078635 15.905331 -20.8829981 16.668041 -0.0623543 -18.6297435 -20.2055890 -2.1122611 -21.3307601 -18.736749 -0.8516470 -0.1496063 -5.895734 -1.3895481 -21.298095 -4.0537964 15.8995094 -2.1242670
Rewards for vaxxing -2.4800226 0.1675458 1.0987561 1.1749595 -17.1431543 -1.974732 -16.3180426 17.976130 -14.2281985 0.8555958 -15.0700253 -0.4013343 -14.0300264 1.246232 1.6691140 1.3687095 19.758530 1.2160986 -10.193438 19.9719896 -1.1017518 -0.4022712
Other -2.8190564 -1.2446304 0.0175658 -0.8980005 -14.4263532 -1.642441 -15.3391947 -1.542944 -16.1476865 -18.2033399 -14.3576227 -0.2826374 -12.3220467 -15.713617 -16.3812674 0.7589556 -1.913640 -19.8553125 -7.851658 -0.8613467 -0.7081405 -0.2773374
Predicted
class
True class
Nothing Job/school required Family supports it Trusted info source Something else Rewards for vaxxing Other
Nothing 1 5 4 0 0 1 0
Job/school required 140 256 126 84 23 29 5
Family supports it 0 0 0 0 0 0 0
Trusted info source 0 0 0 0 0 0 0
Something else 0 0 0 0 0 0 0
Rewards for vaxxing 0 0 0 0 0 0 0
Other 0 0 0 0 0 0 0

[1] “misclassification error:” [1] 0.6186944


  • MeanDecreaseAccuracy gives a rough estimate of the loss in prediction performance when that particular variable is omitted from the training set.
  • MeanDecreaseGini: GINI is a measure of node impurity. Highest purity means that each node contains only elements of a single class. Assessing the decrease in GINI when that feature is omitted leads to an understanding of how important that feature is to split the data correctly.

3.1.1 Random Forest

We now try a random forest model with 70/30 train/test split for the task of predicting preferred treatments from a linear combination of features. The misclassification error still stays as high as 64% (now 57%!).