Raw data

There are three raw data files in data/raw_data/:

  • data_survey.xlsx: Survey responses, with one row per respondent
  • data_choice.xlsx: The conjoint design and choices, with one row per respondent × task × profile (including the “none” option)
  • data_demogr.csv: Respondent demographics from Prolific, with one row per Prolific submission

The cleaning/joining code lives in R/funs_data.R and gets run in the main {targets} pipeline. We create three clean datasets:

Respondents

The survey and Prolific demographic data are joined by Prolific ID, resulting in one row per respondent (respondents):

Code
glimpse(respondents)
## Rows: 1,201
## Columns: 45
## $ id                        <chr> "68a89e07d172fe05dc5a25bb", "68a89e26d172fe0…
## $ respondent_status         <chr> "Complete", "Complete", "Complete", "Complet…
## $ last_question_seen        <chr> "End1-code", "End1-code", "End1-code", "End1…
## $ elapsed_time_hh_mm_ss     <dttm> 1899-12-31 00:05:07, 1899-12-31 00:03:36, 1…
## $ consent                   <chr> "I agree.", "I agree.", "I agree.", "I agree…
## $ donate_freq               <chr> "Occasionally (e.g., once every 3–6 months)"…
## $ donate_amount             <chr> "$200 to $499", "Less than $50", "$50 to $19…
## $ volunteer_freq            <chr> "Frequently (e.g., once a week or once a mon…
## $ work_npo                  <chr> "Yes, in the past", "No", "Yes, in the past"…
## $ attention                 <chr> "Rarely", "Rarely", "Rarely", "Rarely", "Rar…
## $ cbc1_1                    <dbl> 2, 2, 3, 3, 3, 4, 2, 2, 1, 2, 2, 1, 3, 1, 1,…
## $ cbc1_2                    <dbl> 2, 3, 1, 3, 1, 4, 3, 1, 3, 1, 4, 3, 1, 2, 2,…
## $ cbc1_3                    <dbl> 2, 2, 1, 1, 3, 4, 1, 3, 1, 1, 3, 3, 2, 3, 2,…
## $ cbc1_4                    <dbl> 1, 1, 2, 2, 2, 4, 3, 2, 3, 1, 1, 3, 2, 1, 3,…
## $ cbc1_5                    <dbl> 1, 1, 1, 1, 4, 4, 2, 2, 3, 1, 1, 2, 2, 3, 1,…
## $ cbc1_6                    <dbl> 1, 1, 3, 2, 2, 2, 2, 1, 1, 1, 3, 2, 1, 2, 3,…
## $ cbc1_7                    <dbl> 1, 1, 4, 1, 1, 3, 1, 2, 3, 2, 1, 4, 3, 2, 1,…
## $ cbc1_8                    <dbl> 1, 3, 2, 1, 2, 4, 1, 1, 1, 2, 3, 3, 3, 3, 3,…
## $ cbc1_9                    <dbl> 2, 3, 1, 1, 1, 4, 3, 3, 3, 3, 1, 2, 2, 1, 1,…
## $ cbc1_10                   <dbl> 1, 3, 2, 2, 3, 4, 2, 3, 3, 2, 3, 3, 2, 3, 3,…
## $ education                 <chr> "Postgraduate or professional degree", "Bach…
## $ income                    <chr> "$75,000–$99,999", "$50,000–$74,999", "$50,0…
## $ marriage                  <chr> "Currently married or in a domestic partners…
## $ political                 <chr> "Conservative", "Liberal", "Moderate", "Mode…
## $ religion                  <chr> "Yes", "No", "Yes", "Yes", "No", "No", "Yes"…
## $ location                  <dbl> 47138, 33321, 71251, 53114, 27921, 90014, 84…
## $ status                    <chr> "APPROVED", "APPROVED", "APPROVED", "APPROVE…
## $ time_taken                <dbl> 321, 224, 220, 249, 287, 206, 206, 252, 287,…
## $ total_approvals           <dbl> 90, 3408, 39, 11801, 4914, 1318, 5446, 9884,…
## $ fluent_languages          <chr> "English", "English", "English", "English", …
## $ u_s_political_affiliation <chr> "Republican", "Democrat", "Independent", "In…
## $ age                       <dbl> 26, 27, 34, 44, 58, 54, 41, 46, 25, 36, 36, …
## $ sex                       <chr> "Female", "Female", "Male", "Male", "Male", …
## $ ethnicity_simplified      <chr> "White", "Mixed", "White", "White", "White",…
## $ country_of_birth          <chr> "United States", "United States", "United St…
## $ country_of_residence      <chr> "United States", "United States", "United St…
## $ nationality               <chr> "United States", "United States", "United St…
## $ language                  <chr> "English", "English", "English", "English", …
## $ student_status            <chr> NA, NA, "No", "No", "Yes", NA, "No", "No", "…
## $ employment_status         <chr> "Full-Time", NA, "Full-Time", "Full-Time", "…
## $ n_unique_choices          <int> 2, 3, 4, 3, 4, 3, 3, 3, 2, 3, 4, 4, 3, 3, 3,…
## $ elapsed_seconds           <dbl> 307, 216, 205, 231, 277, 194, 193, 245, 274,…
## $ giving                    <fct> Often/occasionally, Rarely/never, Often/occa…
## $ volunteering              <fct> Often/occasionally, Rarely/never, Often/occa…
## $ npo_work                  <fct> Has worked at a nonprofit, Never worked at a…

Conjoint choices

We then join the respondent data to the conjoint choices, after dropping the “none” option (concept 4). Each row is one profile shown in one task; response is 1 if that profile was chosen. Attribute codes are converted to labeled factors, with the first level as the reference category:

Code
conjoint |>
  select(rbi, ubi, nonprofit_type, use_of_donations, financial_situation) |>
  map(\(x) levels(x))
## $rbi
## [1] "Free"          "Reduced price" "Full price"   
## 
## $ubi
## [1] "None"                 "Event space rental"   "Running a pizza shop"
## 
## $nonprofit_type
## [1] "Community arts center"   "Student tutoring center"
## [3] "Urban forestry center"   "Mental health center"   
## 
## $use_of_donations
## [1] "Paying program staff" "Capacity building"    "Rainy day funds"     
## [4] "Unrestricted use"    
## 
## $financial_situation
## [1] "In good condition"      "Under financial stress"
Code
conjoint |>
  summarize(
    respondents = n_distinct(id),
    tasks = n_distinct(task),
    profiles_per_task = n_distinct(concept),
    rows = n()
  )
## # A tibble: 1 × 4
##   respondents tasks profiles_per_task  rows
##         <int> <int>             <int> <int>
## 1        1201    10                 3 36030

Robustness sample

For robustness checks, conjoint_robust filters out respondents who:

  • Didn’t answer the attention check question
  • Finished in the fastest 1% of completion times
  • Chose the same option in all 10 tasks
Code
tibble(
  sample = c("Full", "Robust"),
  respondents = c(n_distinct(conjoint$id), n_distinct(conjoint_robust$id))
)
## # A tibble: 2 × 2
##   sample respondents
##   <chr>        <int>
## 1 Full          1201
## 2 Robust        1153