# Load required libraries
library(dplyr)
library(tidyr)
library(purrr)
library(readr)
library(stringr)
library(jsonlite)
library(magrittr)
library(ggplot2)
library(effectsize)
# Step 1: Import and Combine Data
# Read all CSV files from the specified folder, extract subject IDs from file names,
# and combine them into one data frame.
folder_path <- "/Users/miladutton/Desktop/CSS/CSS204/critcher2013_2/data/osfstorage-archive/pilot_b"
csv_files <- list.files(path = folder_path, pattern = "*.csv", full.names = TRUE, recursive = TRUE)
combined_data <- csv_files %>%
map_dfr(~ {
data <- read_csv(.x)
subject_id <- tools::file_path_sans_ext(basename(.x)) # Extract subject ID from file name
data %>% mutate(subject_id = subject_id, .before = 1) # Add subject ID as the first column
})
# Step 2: Filter Relevant Columns and Add Condition
# Keep only relevant columns, classify stimuli into conditions (moral/immoral),
# and fill down condition labels for each participant.
cleaned_data <- combined_data %>%
select(subject_id, rt, stimulus, response) %>%
mutate(condition = case_when(
str_detect(stimulus, "steal the money") ~ "moral",
str_detect(stimulus, "pocketed the money") ~ "immoral",
TRUE ~ NA_character_
)) %>%
fill(condition, .direction = "down")
# Step 3: Extract Attention Check
# Identify and extract attention check responses for each participant,
# filling them across rows within each subject group.
cleaned_data <- cleaned_data %>%
group_by(subject_id) %>%
mutate(attention_check = if_else(
row_number() == n() & str_detect(response, '"Q0":'),
str_extract(response, '(?<=\\\"Q0\\\":)\\d+'), # Extract Q0 value
NA_character_
)) %>%
fill(attention_check, .direction = "downup") %>%
ungroup() %>%
mutate(attention_check = as.numeric(attention_check)) # Convert to numeric
# Step 4: Parse JSON Responses
# Parse JSON responses, expand them into separate columns, and remove rows
# containing only attention check responses or empty question values.
split_data <- cleaned_data %>%
mutate(response_parsed = map(response, ~ {
tryCatch(fromJSON(.) %>% as.data.frame(), error = function(e) data.frame())
})) %>%
unnest(cols = response_parsed, keep_empty = TRUE) %>%
filter(
!str_detect(response, '^\\{"Q0":\\d+\\}$') & # Exclude attention-check-only rows
!if_all(starts_with("Q"), is.na) # Exclude rows with all Q columns as NA
)
# Step 5: Assign Targets (Justin/Nate)
# Alternate rows between "Justin" and "Nate" for target assignment.
split_data <- split_data %>%
mutate(target = if_else(row_number() %% 2 == 1, "Justin", "Nate"))
# Step 6: Reshape Data to Long Format
# Pivot question columns into long format and combine target and question info.
long_data <- split_data %>%
pivot_longer(
cols = starts_with("Q"),
names_to = "question",
values_to = "response_value"
) %>%
mutate(
question_value = paste(target, question, sep = "_")
) %>%
select(-target, -question, -response, -stimulus)
# Step 7: Filter for Valid Participants
# Keep only valid participants based on attention check and specific response criteria.
cleaned_long_data <- long_data %>%
filter(attention_check == 0)
valid_participants <- cleaned_long_data %>%
filter(
(question_value == "Justin_Q0" & response_value == 1) |
(question_value == "Nate_Q0" & response_value == 0)
) %>%
distinct(subject_id) %>%
pull(subject_id)
cleaned_long_data <- cleaned_long_data %>%
filter(subject_id %in% valid_participants) %>%
mutate(decision_speed = case_when(
str_detect(question_value, "Justin") ~ "quick",
str_detect(question_value, "Nate") ~ "slow",
TRUE ~ NA_character_
))
# Step 8: Filter for Relevant Questions
# Keep only specific questions of interest and convert response values to numeric.
relevant_questions <- c("Justin_Q1", "Justin_Q2", "Justin_Q3", "Nate_Q1", "Nate_Q2", "Nate_Q3")
cleaned_long_data <- cleaned_long_data %>%
filter(question_value %in% relevant_questions) %>%
mutate(response_value = as.numeric(response_value))
# Step 9: Calculate Composite Scores
# Compute average moral scores for Justin and Nate across their respective questions.
cleaned_long_data <- cleaned_long_data %>%
group_by(subject_id) %>%
mutate(
justin_moral_score = mean(response_value[question_value %in% c("Justin_Q1", "Justin_Q2", "Justin_Q3")], na.rm = TRUE),
nate_moral_score = mean(response_value[question_value %in% c("Nate_Q1", "Nate_Q2", "Nate_Q3")], na.rm = TRUE)
) %>%
ungroup()
# Step 10: Final Dataset
# Reshape data for analysis and include relevant attributes.
final_dataset <- cleaned_long_data %>%
select(subject_id, condition, justin_moral_score, nate_moral_score) %>%
distinct() %>%
pivot_longer(
cols = c(justin_moral_score, nate_moral_score),
names_to = "character",
values_to = "moral_score"
) %>%
mutate(
character = ifelse(character == "justin_moral_score", "Justin", "Nate"),
decision_speed = ifelse(character == "Justin", "quick", "slow")
) %>%
select(subject_id, condition, character, decision_speed, moral_score)Replication of Study ‘How Quick Decisions Illuminate Moral Character’ by Critcher et al. (2013, Social Psychological and Personality Science)
Introduction
This paper examines how the speed in making moral decisions can shape how others view as, as well as how we assess our own actions. This is a topic that has always been fascinating to me, especially as a psychology undergrad major, with experience researching cognition. The intersection between decision making and moral cognition touches on the core psychological questions regarding ethics, thought process, and social environments.
The experiment will follow the structure of the original study by having participants read stories regarding making moral decisions at varying speeds. In experiment 1, two men find separate wallets in a parking lot. One man immediately decides what to do with the wallet while the other decides after a “long and careful deliberation”. In the moral condition, both men turn the wallet in, and in the immoral decision both men keep the wallet. Participants are then given questionnaires in which they rank the following sets: quickness, moral character evaluation, certainty, and emotional impulsivity. Experiment 2 follows a similar structure but is between subjects. The story depicts a single mother who is struggling to afford her son. Her boss offers to adopt her son and in return will triple her salary. She is described as either taking 3 seconds or 3 days to come to a decision, and her decision was independently varied. Participants will then use the same scales as well as two additional scales in which they rank her motives to “get more money” and “protect her child”. In our study, we only replicated experiment 1. A two way ANOVA test was run to assess decision speed and type of decision, and a regression analysis was run to further explore relationships between certainty and morality.
A potential challenge is that I do not have experience with this type of data analysis so it will definitely be a learning curve. I am confident in my ability to learn, but I am sure it will take a bit to feel confident doing so.
Methods
Power Analysis
The original study utilizes a series of analyses to determine whether decision speed impacts moral character perception.
Decision on Moral Character: A significant main effect of decision type (F(1, 117) = 541.52, p < .001) revealed that Justin, who decided quickly (M = 6.44, SE = .08), was perceived differently from Nate (M = 2.15, SE = .12). Moral decision also influenced character evaluation (F(1, 117) = 127.07, p < .001), with returning the wallet seen as morally better.
Decision Speed and Emotional Impulsivity: Justin was viewed as less emotionally impulsive (M = 2.40, SE = .11) than Nate (M = 3.79, SE = .12), (F(1, 117) = 95.26, p < .001), but this did not affect moral evaluations (t < 1).
Decision Speed and Moral Evaluation Polarization: The Decision × Speed interaction was significant (F(1, 117) = 127.07, p < .001), with quick immoral decisions leading to more negative evaluations (t(54) = 8.28, p < .001) and quick moral decisions to more positive evaluations (t(63) = 7.71, p < .001).
Certainty as a Mediator: Quick decisions were associated with higher certainty (F(1, 117) = 706.6, p < .001). Certainty mediated the relationship between decision speed and moral evaluation, with greater certainty explaining more negative evaluations for immoral decisions and more positive evaluations for moral ones.
We planned to perform power analyses to determine the sample sizes needed to achieve 80%, 90%, 95% power for detecting effect sizes from the original study. However, the original study did not give exact effect sizes, difference between means, or error bars. For that reason, we were unable to calculate effect size and determine sample size through that methodology. The original study had 119 participants, so we followed the standard practice of doing 2.5 times the original sample, leaving us with a sample size of 298.
Planned Sample
Based on the original studies findings, we planned to have a sample size of approximately 298 participants. This is 2.5 times the original sample size. However, due to funding we ended up doing 1/3 of that, with a sample size of 100. The sampling frame consisted of individuals in the participant pool on the website Prolific. The only preselection rule was that participants must be fluent in English and be approved for at least 95% of the studies they applied to.
Materials
Participants in this study were presented with a story focusing on two men, as outlined in the original article. Through reaching out to the original researchers, we were able to get access to their exact materials. The story was structured as follows.
“Justin and Nate were walking to separate cars in the parking lot of Andronico’s, a local grocery store, when they each spotted a different lost wallet next to their cars. Upon picking up the wallet and looking inside, each found several hundred dollars in cash. Each man considered whether he should return the wallet and money to the Customer Service desk at Andronico’s, or pocket the money and drive away.”
Moral Condition
“Justin saw his decision as an easy one and was able to decide quickly. He did not steal the money and instead left the wallet with Customer Service.”
“In contrast, Nate saw his decision as difficult and was only able to decide after long and careful deliberation. After several minutes of thinking in his car, he too decided not to steal the money and instead left the wallet with Customer Service.”
Immoral Condition
“Justin saw his decision as an easy one and was able to decide quickly. He pocketed the money and drove off.”
“In contrast, Nate saw his decision as difficult and was only able to decide after long and careful deliberation. After several minutes of thinking in his car, he too decided to pocket the money and drive off.”
Immediately following the description of Justin and Nate’s actions, participants answered a series of questions related to the men’s moral character evaluation. These questions were rated on a 1-7 scale. These questions were also taken directly from the original research.
Quickness:
- Did [Character] make his decision quickly or slowly? (1 = particularly slowly, 7 = particularly quickly)
Moral Character Evaluation:
- Regardless of [Character]’s decision, does it sound like [Character] has underlying moral principles that are good, bad, or somewhere in between? (1 = completely bad, 4 = mixed, 7 = completely good)
- Regardless of [Character]’s decision, do you think Justin has moral standards that are good, bad, or somewhere in between? (1 = completely bad, 4 = mixed, 7 = completely good)
- Regardless of [Character]‘s decision, do you think Justin possesses the moral knowledge and principles necessary to do ‘the right thing’? (1 = not at all, 4 = somewhat, 7 = completely)
Certainty:
- Would you say [Character] was quite certain in his decision, or did [Character] have hesitations about his or her decision? (1 = completely certain, 7 = considerable hesitations)
- How close do you think [Character] was to choosing the alternate course of action? (1 = very close to, 7 = not close at all)
- How conflicted do you think [Character] felt in making the decision? (1 = very conflicted, 7 = not at all conflicted)
- Based on the information provided, do you think [Character] had many reservations about the decision? (1 = none at all, 7 = a whole lot)
Emotional impulsivity:
- Do you think Justin (or Nate) was calm and emotionally contained while making the decision? (1 = not at all, 7 = entirely so)
- To what extent do you think Justin (or Nate) became upset and acted without thinking? (1 = not at all, 7 = entirely so)
Procedure
Participants read about two men, Justin and Nate, who come upon separate cash-filled wallets in a grocery store parking lot. Justin “was able to decide quickly” what to do, while Nate “was only able to decide after long and careful deliberation.”
Participants read stories from one of the following conditions:
Moral decision: Justin and Nate both decide not to steal the money and return the wallets.
Immoral decision: Justin and Nate both decide to keep the money and drive off.
Note:
- This procedure was followed precisely as outlined in the original article without deviations.
After reading the story, they were presented with the questions where they evaluated the speed, moral character, certainty, and impulsivity of both Justin and Nate. An attention check was also added to the end of the questions, to ensure that participants were present in the study.
Analysis Plan
To begin analysis, I cleaned the data by excluding participants with missing data. If participants failed the manipulation check or attention check, their data was also excluded. To calculate the moral character evaluation composite score, I took the mean of the 3 moral character evaluation questions, and added that into the dataset. The final dataset used in analysis consisted only of: subject id, condition, character, decision speed, and moral score.
The key analysis of interest is the effect of decision speed and decision type on moral character evaluation. This analysis helped confirm whether the original findings (that moral judgments are influenced by both the speed of the decision and the choice) are replicable in my sample.
Design Overview
Two factors were manipulated: decision type and decision speed.
Four measures were taken: quickness, moral character evaluation, certainty, emotional impulsivity.
It was a within subjects design.
Measures were repeated.
There was no mention of steps taken to reduce demand characteristics.
Participants with previous traumatic exposure to a relevant situation or personal ties may have strong feelings regarding moral evaluation, which may serve as a confounding variable.
Differences from Original Study
The main difference from the original study is that we performed one experiment rather than two. Specifically, we replicated experiment 1.
Our participant pool was also different. The original paper included mainly undergraduate students at UC Berkeley, as well as members from the surrounding community. As I am not a part of that institution, my participants were not from that community. I conducted this study entirely online, unlike the original study, which did not specify whether participants were tested in a lab or online. Using Prolific, we did not impose any regional restrictions, which meant I couldn’t control the exact environment in which participants completed the study. Lastly, I added an attention check at the end of the questions which the original study did not have. This was to ensure that participants were not just clicking through, and to help minimize bots. These differences are not expected to make a difference in obtaining the effect.
Methods Addendum (Post Data Collection)
You can comment this section out prior to final report with data collection.
Actual Sample
Sample size, demographics, data exclusions based on rules spelled out in analysis plan
Differences from pre-data collection methods plan
Any differences from what was described as the original plan, or “none”.
Results
Data preparation
To prepare the dataset for analysis, I implemented a detailed cleaning process to ensure its integrity and reliability. Missing values were removed to maintain data quality, and participants who failed attention checks were excluded from the analysis. A condition column was added to categorize scenarios into moral or immoral decisions. Responses were parsed to extract structured data from JSON format, handling invalid responses to avoid errors. The dataset was then reshaped into a long format, which allowed for easier manipulation and analysis. Composite scores for moral evaluations were calculated for each character, providing a clear and structured summary of the data. These steps ensured the dataset was properly formatted, high-quality, and ready for statistical analysis and visualization.
Confirmatory analysis
A two-way ANOVA was conducted to examine the main effects of decision type (whether participants decided to return or keep the wallet) and decision speed (quick or slow) on the moral character evaluation. This analysis allowed me to assess how these factors independently influenced moral judgments.
# Perform Two-Way ANOVA
anova_results <- aov(moral_score ~ condition * decision_speed, data = final_dataset)
# Display the ANOVA table
summary(anova_results) Df Sum Sq Mean Sq F value Pr(>F)
condition 1 6.717 6.717 5.047 0.0485 *
decision_speed 1 0.127 0.127 0.095 0.7638
condition:decision_speed 1 0.384 0.384 0.289 0.6029
Residuals 10 13.311 1.331
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Bar Plot
ggplot(final_dataset, aes(x = condition, y = moral_score, fill = decision_speed)) +
stat_summary(
fun = "mean",
geom = "bar",
position = position_dodge(0.7),
color = "black",
width = 0.6
) +
stat_summary(
fun.data = "mean_cl_boot",
geom = "linerange",
position = position_dodge(0.7),
linewidth = 0.8
) +
scale_fill_manual(values = c("gray", "blue")) +
labs(
title = "Moral Character Evaluation",
x = "Condition",
y = "Mean Moral Score",
fill = "Decision Speed"
) +
theme_minimal()Side-by-side graph with original graph is ideal here
Exploratory analyses
Any follow-up analyses desired (not required).
#Exploring the effect size
effect_sizes <- eta_squared(anova_results, partial = TRUE)
print(effect_sizes)# Effect Size for ANOVA (Type I)
Parameter | Eta2 (partial) | 95% CI
--------------------------------------------------------
condition | 0.34 | [0.00, 1.00]
decision_speed | 9.45e-03 | [0.00, 1.00]
condition:decision_speed | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Discussion
Summary of Replication Attempt
Open the discussion section with a paragraph summarizing the primary result from the confirmatory analysis and the assessment of whether it replicated, partially replicated, or failed to replicate the original result.
Commentary
Add open-ended commentary (if any) reflecting (a) insights from follow-up exploratory analysis, (b) assessment of the meaning of the replication (or not) - e.g., for a failure to replicate, are the differences between original and present study ones that definitely, plausibly, or are unlikely to have been moderators of the result, and (c) discussion of any objections or challenges raised by the current and original authors about the replication attempt. None of these need to be long.