Empathy motivation is preserved following amygdala damage.
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R · 713 lines · 30 KB · no license
- ## Empathy motivation is preserved following amygdala damage ##
- #### Load Required Packages ####
- require(base)
- require(float)
- require(quanteda)
- require(Matrix)
- require(stats)
- require(dplyr)
- require(tidyr)
- require(rio)
- require(SnowballC)
- require(stringi)
- require(stringr)
- require(textclean)
- require(tidyr)
- require(utils)
- require(bayesanova)
- require(lme4)
- #### This will bring up a dialogue box to import the SPSS file into the environment ####
- EmpLesion <- import(file.choose(new=FALSE), setclass = getOption("rio.import.class", "data.frame"))
- # Remove participants who did not complete the affective EST #
- EmpLesionNoEST <- subset(EmpLesion, AffectiveEST_Avg != 'NA')
- EmpLesionNoCogEST <- subset(EmpLesion, CognitiveEST_Avg != 'NA')
- #### Empathy Choice Bayes Anova Testing ####
- ## Affective EST ##
- amygAff <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==1,]$AffectiveEST_Avg
- bdcAff <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==3,]$AffectiveEST_Avg
- hcAff <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==4,]$AffectiveEST_Avg
- ## Cognitive EST ##
- amygCog <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==1,]$CognitiveEST_Avg
- bdcCog <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==3,]$CognitiveEST_Avg
- hcCog <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==4,]$CognitiveEST_Avg
- ## Affective EST ##
- assumption.check(amygAff,bdcAff,hcAff,conf.level=0.95)
- set.seed(42)
- result = bayes.anova(first=amygAff,second=bdcAff,third=hcAff,n=10000)
- anovaplot(result)
- post.pred.check(anovafit = result, ngroups = 3, out = EmpLesionNoEST$AffectiveEST_Avg,
- reps = 50, eta = c(1/3,1/3,1/3))
- ## Cognitive EST ##
- assumption.check(amygCog,bdcCog,hcCog,conf.level=0.95)
- set.seed(43)
- result = bayes.anova(first=amygCog,second=bdcCog,third=hcCog,n=10000)
- anovaplot(result)
- post.pred.check(anovafit = result, ngroups = 3, out = EmpLesionNoCogEST$CognitiveEST_Avg,
- reps = 50, eta = c(1/3,1/3,1/3))
- #### Cognitive Cost Bayes Testing ####
- ## Data Gather for Cognitive Cost Bayes Analyses ##
- ## Affective EST ##
- # Empathy Deck #
- amygAff_Aeff <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==1,]$AffectiveEST_EmpathyEffort
- bdcAff_Aeff <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==3,]$AffectiveEST_EmpathyEffort
- hcAff_Aeff <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==4,]$AffectiveEST_EmpathyEffort
- amygAff_Aavr <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==1,]$AffectiveEST_EmpathyAversion
- bdcAff_Aavr <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==3,]$AffectiveEST_EmpathyAversion
- hcAff_Aavr <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==4,]$AffectiveEST_EmpathyAversion
- amygAff_Aeffi <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==1,]$AffectiveEST_EmpathyEfficacy
- bdcAff_Aeffi <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==3,]$AffectiveEST_EmpathyEfficacy
- hcAff_Aeffi <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==4,]$AffectiveEST_EmpathyEfficacy
- # Non-Empathy Deck #
- amygAff_AeffNonEmp <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==1,]$AffectiveEST_NonEmpathyEffort
- bdcAff_AeffNonEmp <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==3,]$AffectiveEST_NonEmpathyEffort
- hcAff_AeffNonEmp <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==4,]$AffectiveEST_NonEmpathyEffort
- amygAff_AavrNonEmp <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==1,]$AffectiveEST_NonEmpathyAversion
- bdcAff_AavrNonEmp <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==3,]$AffectiveEST_NonEmpathyAversion
- hcAff_AavrNonEmp <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==4,]$AffectiveEST_NonEmpathyAversion
- amygAff_AeffiNonEmp <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==1,]$AffectiveEST_NonEmpathyEfficacy
- bdcAff_AeffiNonEmp <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==3,]$AffectiveEST_NonEmpathyEfficacy
- hcAff_AeffiNonEmp <- EmpLesionNoEST[EmpLesionNoEST$LesionGroup==4,]$AffectiveEST_NonEmpathyEfficacy
- ## Cognitive EST ##
- # Empathy Deck #
- amygCog_Aeff <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==1,]$CognitiveEST_EmpathyEffort
- bdcCog_Aeff <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==3,]$CognitiveEST_EmpathyEffort
- hcCog_Aeff <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==4,]$CognitiveEST_EmpathyEffort
- amygCog_Aavr <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==1,]$CognitiveEST_EmpathyAversion
- bdcCog_Aavr <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==3,]$CognitiveEST_EmpathyAversion
- hcCog_Aavr <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==4,]$CognitiveEST_EmpathyAversion
- amygCog_Aeffi <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==1,]$CognitiveEST_EmpathyEfficacy
- bdcCog_Aeffi <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==3,]$CognitiveEST_EmpathyEfficacy
- hcCog_Aeffi <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==4,]$CognitiveEST_EmpathyEfficacy
- # Non-Empathy Deck #
- amygCog_AeffNonEmp <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==1,]$CognitiveEST_NonEmpathyEffort
- bdcCog_AeffNonEmp <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==3,]$CognitiveEST_NonEmpathyEffort
- hcCog_AeffNonEmp <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==4,]$CognitiveEST_NonEmpathyEffort
- amygCog_AavrNonEmp <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==1,]$CognitiveEST_NonEmpathyAversion
- bdcCog_AavrNonEmp <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==3,]$CognitiveEST_NonEmpathyAversion
- hcCog_AavrNonEmp <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==4,]$CognitiveEST_NonEmpathyAversion
- amygCog_AeffiNonEmp <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==1,]$CognitiveEST_NonEmpathyEfficacy
- bdcCog_AeffiNonEmp <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==3,]$CognitiveEST_NonEmpathyEfficacy
- hcCog_AeffiNonEmp <- EmpLesionNoCogEST[EmpLesionNoCogEST$LesionGroup==4,]$CognitiveEST_NonEmpathyEfficacy
- #### Cognitive Costs - Effort ####
- ## Affective EST ##
- # omit bdc with missing data #
- bdcAff_Aeffomit <- as.numeric(na.omit(bdcAff_Aeff))
- assumption.check(amygAff_Aeff,bdcAff_Aeffomit,hcAff_Aeff,amygAff_AeffNonEmp,bdcAff_AeffNonEmp,hcAff_AeffNonEmp,conf.level=0.95)
- set.seed(46)
- result = bayes.anova(first=amygAff_Aeff,second=bdcAff_Aeffomit,third=hcAff_Aeff,
- fourth=amygAff_AeffNonEmp,fifth=bdcAff_AeffNonEmp,sixth=hcAff_AeffNonEmp, n=10000)
- anovaplot(result)
- ## Cognitive EST ##
- set.seed(47)
- result = bayes.anova(first=amygCog_Aeff,second=bdcCog_Aeff,third=hcCog_Aeff,
- fourth=amygCog_AeffNonEmp,fifth=bdcCog_AeffNonEmp,sixth=hcCog_AeffNonEmp, n=10000)
- anovaplot(result)
- #### Cognitive Costs - Aversiveness #####
- ## Affective EST ##
- # omit bdc with missing data #
- bdcAff_Aavromit <- as.numeric(na.omit(bdcAff_Aavr))
- assumption.check(amygAff_Aavr,bdcAff_Aavromit,hcAff_Aavr,amygAff_AavrNonEmp,bdcAff_AavrNonEmp,hcAff_AavrNonEmp,conf.level=0.95)
- set.seed(50)
- result = bayes.anova(first=amygAff_Aavr,second=bdcAff_Aavromit,third=hcAff_Aavr,
- fourth=amygAff_AavrNonEmp,fifth=bdcAff_AavrNonEmp,sixth=hcAff_AavrNonEmp, n=10000)
- anovaplot(result)
- ## Cognitive EST ##
- set.seed(51)
- result = bayes.anova(first=amygCog_Aavr,second=bdcCog_Aavr,third=hcCog_Aavr,
- fourth=amygCog_AavrNonEmp,fifth=bdcCog_AavrNonEmp,sixth=hcCog_AavrNonEmp, n=10000)
- anovaplot(result)
- #### Cognitive Costs - Efficacy ####
- ## Affective EST ##
- # omit bdc with missing data #
- bdcAff_Aeffiomit <- as.numeric(na.omit(bdcAff_Aeffi))
- assumption.check(amygAff_Aeffi,bdcAff_Aeffiomit,hcAff_Aeffi,amygAff_AeffiNonEmp,bdcAff_AeffiNonEmp,hcAff_AeffiNonEmp,conf.level=0.95)
- set.seed(54)
- result = bayes.anova(first=amygAff_Aeffi,second=bdcAff_Aeffiomit,third=hcAff_Aeffi,
- fourth=amygAff_AeffiNonEmp,fifth=bdcAff_AeffiNonEmp,sixth=hcAff_AeffiNonEmp, n=10000)
- anovaplot(result)
- ## Cognitive EST ##
- set.seed(55)
- result = bayes.anova(first=amygCog_Aeffi,second=bdcCog_Aeffi,third=hcCog_Aeffi,
- fourth=amygCog_AeffiNonEmp,fifth=bdcCog_AeffiNonEmp,sixth=hcCog_AeffiNonEmp, n=10000)
- anovaplot(result)
- #### Affective EST - Text Data ####
- ## Create tibble for just empathy responses ##
- EmpLesiontibble <- tibble(id = EmpLesionNoEST$ID,
- lesionGroup = EmpLesionNoEST$LesionGroup,
- choice.1 = EmpLesionNoEST$AffectiveEST_Q1Choice,
- choice.2 = EmpLesionNoEST$AffectiveEST_Q2Choice,
- choice.3 = EmpLesionNoEST$AffectiveEST_Q3Choice,
- choice.4 = EmpLesionNoEST$AffectiveEST_Q4Choice,
- choice.5 = EmpLesionNoEST$AffectiveEST_Q5Choice,
- choice.6 = EmpLesionNoEST$AffectiveEST_Q6Choice,
- choice.7 = EmpLesionNoEST$AffectiveEST_Q7Choice,
- choice.8 = EmpLesionNoEST$AffectiveEST_Q8Choice,
- choice.9 = EmpLesionNoEST$AffectiveEST_Q9Choice,
- choice.10 = EmpLesionNoEST$AffectiveEST_Q10Choice,
- choice.11 = EmpLesionNoEST$AffectiveEST_Q11Choice,
- choice.12 = EmpLesionNoEST$AffectiveEST_Q12Choice,
- choice.13 = EmpLesionNoEST$AffectiveEST_Q13Choice,
- choice.14 = EmpLesionNoEST$AffectiveEST_Q14Choice,
- choice.15 = EmpLesionNoEST$AffectiveEST_Q15Choice,
- choice.16 = EmpLesionNoEST$AffectiveEST_Q16Choice,
- choice.17 = EmpLesionNoEST$AffectiveEST_Q17Choice,
- choice.18 = EmpLesionNoEST$AffectiveEST_Q18Choice,
- choice.19 = EmpLesionNoEST$AffectiveEST_Q19Choice,
- choice.20 = EmpLesionNoEST$AffectiveEST_Q20Choice,
- choice.21 = EmpLesionNoEST$AffectiveEST_Q21Choice,
- choice.22 = EmpLesionNoEST$AffectiveEST_Q22Choice,
- choice.23 = EmpLesionNoEST$AffectiveEST_Q23Choice,
- choice.24 = EmpLesionNoEST$AffectiveEST_Q24Choice,
- choice.25 = EmpLesionNoEST$AffectiveEST_Q25Choice,
- choice.26 = EmpLesionNoEST$AffectiveEST_Q26Choice,
- choice.27 = EmpLesionNoEST$AffectiveEST_Q27Choice,
- choice.28 = EmpLesionNoEST$AffectiveEST_Q28Choice,
- choice.29 = EmpLesionNoEST$AffectiveEST_Q29Choice,
- choice.30 = EmpLesionNoEST$AffectiveEST_Q30Choice,
- choice.31 = EmpLesionNoEST$AffectiveEST_Q31Choice,
- choice.32 = EmpLesionNoEST$AffectiveEST_Q32Choice,
- choice.33 = EmpLesionNoEST$AffectiveEST_Q33Choice,
- choice.34 = EmpLesionNoEST$AffectiveEST_Q34Choice,
- choice.35 = EmpLesionNoEST$AffectiveEST_Q35Choice,
- choice.36 = EmpLesionNoEST$AffectiveEST_Q36Choice,
- choice.37 = EmpLesionNoEST$AffectiveEST_Q37Choice,
- choice.38 = EmpLesionNoEST$AffectiveEST_Q38Choice,
- choice.39 = EmpLesionNoEST$AffectiveEST_Q39Choice,
- choice.40 = EmpLesionNoEST$AffectiveEST_Q40Choice,
- response.1 = EmpLesionNoEST$AffectiveEST_Q1Response,
- response.2 = EmpLesionNoEST$AffectiveEST_Q2Response,
- response.3 = EmpLesionNoEST$AffectiveEST_Q3Response,
- response.4 = EmpLesionNoEST$AffectiveEST_Q4Response,
- response.5 = EmpLesionNoEST$AffectiveEST_Q5Response,
- response.6 = EmpLesionNoEST$AffectiveEST_Q6Response,
- response.7 = EmpLesionNoEST$AffectiveEST_Q7Response,
- response.8 = EmpLesionNoEST$AffectiveEST_Q8Response,
- response.9 = EmpLesionNoEST$AffectiveEST_Q9Response,
- response.10 = EmpLesionNoEST$AffectiveEST_Q10Response,
- response.11 = EmpLesionNoEST$AffectiveEST_Q11Response,
- response.12 = EmpLesionNoEST$AffectiveEST_Q12Response,
- response.13 = EmpLesionNoEST$AffectiveEST_Q13Response,
- response.14 = EmpLesionNoEST$AffectiveEST_Q14Response,
- response.15 = EmpLesionNoEST$AffectiveEST_Q15Response,
- response.16 = EmpLesionNoEST$AffectiveEST_Q16Response,
- response.17 = EmpLesionNoEST$AffectiveEST_Q17Response,
- response.18 = EmpLesionNoEST$AffectiveEST_Q18Response,
- response.19 = EmpLesionNoEST$AffectiveEST_Q19Response,
- response.20 = EmpLesionNoEST$AffectiveEST_Q20Response,
- response.21 = EmpLesionNoEST$AffectiveEST_Q21Response,
- response.22 = EmpLesionNoEST$AffectiveEST_Q22Response,
- response.23 = EmpLesionNoEST$AffectiveEST_Q23Response,
- response.24 = EmpLesionNoEST$AffectiveEST_Q24Response,
- response.25 = EmpLesionNoEST$AffectiveEST_Q25Response,
- response.26 = EmpLesionNoEST$AffectiveEST_Q26Response,
- response.27 = EmpLesionNoEST$AffectiveEST_Q27Response,
- response.28 = EmpLesionNoEST$AffectiveEST_Q28Response,
- response.29 = EmpLesionNoEST$AffectiveEST_Q29Response,
- response.30 = EmpLesionNoEST$AffectiveEST_Q30Response,
- response.31 = EmpLesionNoEST$AffectiveEST_Q31Response,
- response.32 = EmpLesionNoEST$AffectiveEST_Q32Response,
- response.33 = EmpLesionNoEST$AffectiveEST_Q33Response,
- response.34 = EmpLesionNoEST$AffectiveEST_Q34Response,
- response.35 = EmpLesionNoEST$AffectiveEST_Q35Response,
- response.36 = EmpLesionNoEST$AffectiveEST_Q36Response,
- response.37 = EmpLesionNoEST$AffectiveEST_Q37Response,
- response.38 = EmpLesionNoEST$AffectiveEST_Q38Response,
- response.39 = EmpLesionNoEST$AffectiveEST_Q39Response,
- response.40 = EmpLesionNoEST$AffectiveEST_Q40Response)
- ## Add id number (may not need with carrying over the ID) ##
- #EmpLesiontibble <- EmpLesiontibble %>%
- # mutate(EmpLesiontibble, id=row_number())
- ## Categorize responses based on choice ##
- EmpLesiontibbleChoice <- EmpLesiontibble %>%
- select(id:choice.40)
- EmpLesiontibbleChoice <- EmpLesiontibbleChoice %>%
- pivot_longer(cols = choice.1:choice.40,
- names_to="trial",
- values_to = "Choice")
- EmpLesiontibbleResponses <- EmpLesiontibble %>%
- select(id,lesionGroup,response.1:response.40)
- EmpLesiontibbleResponses <- EmpLesiontibbleResponses %>%
- pivot_longer(cols = response.1:response.40,
- names_to="trial",
- values_to="Text")
- EmpLesiontibbleLong <- cbind(EmpLesiontibbleChoice, EmpLesiontibbleResponses)
- EmpLesiontibbleLong <- subset(EmpLesiontibbleLong, select=-(3))
- EmpLesiontibbleLong <- subset(EmpLesiontibbleLong, select=-(4))
- EmpLesiontibbleLong <- subset(EmpLesiontibbleLong, select=-(4))
- EmpLesiontibbleLong <- subset(EmpLesiontibbleLong, select=-(4))
- trial <- gsub("choice.","", EmpLesiontibbleChoice$trial)
- EmpLesiontibbleLong <- cbind(EmpLesiontibbleLong,trial)
- rm(EmpLesiontibbleChoice)
- rm(EmpLesiontibbleResponses)
- rm(trial)
- ## Text Analysis ##
- # Import the dictionaries (Brady et al., 2017, PNAS)
- affectDictionary <- read.csv(file.choose(new=FALSE),header=FALSE)
- posAffect <- read.csv(file.choose(new=FALSE),header=FALSE)
- negAffect <- read.csv(file.choose(new=FALSE),header=FALSE)
- # Convert use of wildcard symbol in R (* -> ^) to allow for extensions of the word #
- affectDictionary <- lapply(affectDictionary,glob2rx)
- posAffect <- lapply(posAffect,glob2rx)
- negAffect <- lapply(negAffect,glob2rx)
- # Change to character array for easier comparison against the written text #
- affectDictionary <- array(unlist(affectDictionary))
- posAffect <- array(unlist(posAffect))
- negAffect <- array(unlist(negAffect))
- # Revision (10.7.2025): Combine character vectors for affect, positive, negative dictionaries and remove duplicates #
- combinedAffect <- c(affectDictionary,negAffect,posAffect)
- combinedAffect <- unique(combinedAffect)
- # Researcher Coding Team identified missing words from the dictionaries that were written into participant responses; some are duplicates #
- missedWords <- c('somber', 'curious', 'astonished', 'wondering', 'attentive','watchful','curious', 'intense', 'angry',
- 'cranky', 'tired', 'let down', 'wonderment', 'bewildered', 'pouty', 'wanting', 'neutral', 'miserable',
- 'happy', 'pain', 'spunk', 'trapped', 'hiding', 'hurt', 'safe', 'perplexed', 'leaving', 'gives up', 'beat',
- 'awed', 'caged', 'mischevious', 'mediocre', 'disappointed', 'defiant', 'onery', 'untrusting', 'disappointed',
- 'untrusting', 'contempt', 'despondent', 'mistrust', 'disgust', 'despair', 'broken', 'introverted', 'needing',
- 'recovering', 'disconnected', 'rambunctious', 'content', 'quiet', 'sleepy', 'sick', 'hate', 'hard', 'scared',
- 'bored', 'lonely', 'grief', 'lost', 'mean', 'openness', 'worn out', 'starving', 'unhealthy', 'alone', 'frown',
- 'flat', 'dehydrated', 'good', 'unsure', 'weary', 'tear-streaked', 'pensive', 'cautiously', 'bad', 'disheeveled',
- 'uninterested', 'impulsive', 'intrigued', 'assessing', 'observant', 'clinging', 'secluded', 'unwell',
- 'suffering', 'stoic', 'wary', 'pleading', 'trapped', 'oppression', 'concern', 'questioning', 'hungry',
- 'inquisitive', 'self-assured', 'cocky', 'forlorn', 'dejected', 'approval', 'puzzled', 'resilience',
- 'betrayed', 'cautious', 'alert', 'resolute', 'steadfast', 'sassy', 'perplexed', 'intent', 'focused',
- 'guarded', 'distant', 'abandoned', 'peaceful', 'care', 'shamed', 'scowling', 'disbelief', 'drive',
- 'revengeful', 'stern', 'hardened', 'tearful', 'indifference', 'agitated', 'inquisitive', 'dear')
- # Remove Duplicates #
- missedWords <- unique(missedWords)
- # Convert use of wildcard symbol in R (* -> ^) to allow for extensions of the word #
- missedWords <- lapply(missedWords,glob2rx)
- # Change to character array for easier comparison against the written text #
- missedWords <- array(unlist(missedWords))
- # Combine with the earlier character vector that had the combined positive, negative, and affect dictionaries #
- combinedAffect <- c(combinedAffect,missedWords)
- combinedAffect <- unique(combinedAffect)
- # Delete the missedWords vector #
- rm(missedWords)
- ## Common False Positives Identified by Researcher Coding Team (in context of participant responses) ##
- combinedAffect <- combinedAffect[!combinedAffect %in% c('^like$','^likes$','^liked$','^plays$','^please','^pretty$')]
- affectDictionary <- affectDictionary[!affectDictionary %in% c('^like$','^likes$','^liked$','^plays$','^please','^pretty$')]
- posAffect <- posAffect[!posAffect %in% c('^like$','^likes$','^liked$','^plays$','^please','^pretty$')]
- negAffect <- negAffect[!negAffect %in% c('^like$','^likes$','^liked$','^plays$','^please','^pretty$')]
- # Word count per response #
- EmpLesiontibbleLong$numWords <- stri_count_words(EmpLesiontibbleLong$Text)
- # Text cleaning: see descriptions below #
- EmpLesiontibbleLong$TextCleaned <- EmpLesiontibbleLong$Text %>%
- str_to_lower() %>% # convert all the string to low alphabet
- replace_contraction() %>% # replace contraction to their multi-word forms
- replace_internet_slang() %>% # replace internet slang to normal words
- replace_emoji() %>% # replace emoji to words
- replace_emoticon() %>% # replace emoticon to words
- replace_hash(replacement = "") %>% # remove hashtag
- replace_word_elongation() %>% # replace informal writing with known semantic replacements
- replace_number(remove = T) %>% # remove number
- replace_date(replacement = "") %>% # remove date
- replace_time(replacement = "") %>% # remove time
- str_remove_all(pattern = "[[:punct:]]") %>% # remove punctuation
- str_remove_all(pattern = "[^\\s]*[0-9][^\\s]*") %>% # remove mixed string n number
- str_squish() %>% # reduces repeated whitespace inside a string.
- str_trim() # removes whitespace from start and end of string
- # WordStem (not used in manuscript, but provided if helpful) #
- EmpLesiontibbleLong$TextCleanedStem <- EmpLesiontibbleLong$TextCleaned %>%
- wordStem()
- # Build a list for the identification of affect words #
- EmpLesionTextList <- list(item1=EmpLesiontibbleLong$id, item2=EmpLesiontibbleLong$lesionGroup,
- item3=EmpLesiontibbleLong$Choice, item4=EmpLesiontibbleLong$Text,
- item5=EmpLesiontibbleLong$trial, item6 = EmpLesiontibbleLong$numWords,
- item7 = EmpLesiontibbleLong$TextCleaned, item8=EmpLesiontibbleLong$TextCleanedStem)
- #### Identifier Loop for Emotion Word Counts ####
- # These are safeties in case replication of the loop is needed (remove first # for creating a backup, remove the second # for resetting the list)
- #copyEmpLesiontibbleLong <- EmpLesiontibbleLong
- #EmpLesiontibbleLong <- copyEmpLesiontibbleLong
- # This for loop splits the written text into separate words, compares across each word with the three dictionaries, and stores both the
- # count and the word in the list for interpretation later #
- for (i in 1:nrow(EmpLesiontibbleLong)) {
- cc <- as.numeric()
- d <- as.numeric()
- e <- as.numeric()
- f <- as.numeric()
- hh <- as.character()
- ii <- as.character()
- jj <- as.character()
- kk <- as.character()
- if (i %% 100==0){
- print(i)}
- x <- unlist(strsplit(trimws(EmpLesiontibbleLong$TextCleaned[i]), "\\s+"))
- if(identical(x,character(0))) next
- for (k in 1:length(affectDictionary)) {
- y <- grepl(affectDictionary[k],x)
- cc[k] <- sum(y=="TRUE",na.rm=T)
- if(!(identical(grep(affectDictionary[k],x,value=TRUE),character(0)))){
- z <- grep(affectDictionary[k],x,value=TRUE)
- if(k==1){
- hh<-z
- }
- if(k>1){
- hh <- c(hh,z)}
- }
- }
- for(k in 1:length(negAffect)){
- y <- grepl(negAffect[k],x)
- d[k] <- sum(y=="TRUE",na.rm=T)
- if(!(identical(grep(negAffect[k],x,value=TRUE),character(0)))){
- z <- grep(negAffect[k],x,value=TRUE)
- if(k==1){
- ii<-z
- }
- if(k>1){
- ii <- c(ii,z)
- }
- }
- }
- for(k in 1:length(posAffect)){
- y <- grepl(posAffect[k],x)
- e[k] <- sum(y=="TRUE",na.rm=T)
- if(!(identical(grep(posAffect[k],x,value=TRUE),character(0)))){
- z <- grep(posAffect[k],x,value=TRUE)
- if(k==1){
- jj<-z
- }
- if(k>1){
- jj <- c(jj,z)
- }
- }
- }
- for(k in 1:length(combinedAffect)){
- y <- grepl(combinedAffect[k],x)
- f[k] <- sum(y=="TRUE",na.rm=T)
- if(!(identical(grep(combinedAffect[k],x,value=TRUE),character(0)))){
- z <- grep(combinedAffect[k],x,value=TRUE)
- if(k==1){
- kk<-z
- }
- if(k>1){
- kk <- c(kk,z)
- }
- }
- }
- EmpLesiontibbleLong$affectWordsCount[i] <- sum(cc)
- EmpLesiontibbleLong$negaffectWordsCount[i] <- sum(d)
- EmpLesiontibbleLong$posaffectWordsCount[i] <- sum(e)
- EmpLesiontibbleLong$combinedaffectWordsCount[i] <- sum(f)
- if(identical(hh,character(0))){
- EmpLesionTextList[['item9']][[i]] <- NA
- }
- else if (!(identical(hh,character(0)))) {
- EmpLesionTextList[['item9']][[i]] <- hh
- }
- if(identical(ii,character(0))){
- EmpLesionTextList[['item10']][[i]] <- NA
- }
- else if (!(identical(ii,character(0)))){
- EmpLesionTextList[['item10']][[i]] <- ii
- }
- if(identical(jj,character(0))){
- EmpLesionTextList[['item11']][[i]] <- NA
- }
- else if (!(identical(jj,character(0)))) {
- EmpLesionTextList[['item11']][[i]] <- jj
- }
- if(identical(kk,character(0))){
- EmpLesionTextList[['item12']][[i]] <- NA
- }
- else if (!(identical(kk,character(0)))) {
- EmpLesionTextList[['item12']][[i]] <- kk
- }
- cc <- as.numeric()
- d <- as.numeric()
- e <- as.numeric()
- f <- as.numeric()
- hh <- as.character()
- ii <- as.character()
- jj <- as.character()
- kk <- as.character()
- rm(x)
- rm(y)
- rm(z)
- }
- # Clean the environment #
- rm(cc)
- rm(d)
- rm(e)
- rm(hh)
- rm(i)
- rm(ii)
- rm(jj)
- rm(f)
- rm(kk)
- rm(k)
- # store the counts in the tibble as well #
- EmpLesiontibbleLong$affectUsed[EmpLesiontibbleLong$affectWordsCount>=1] <- 1
- EmpLesiontibbleLong$affectUsed[EmpLesiontibbleLong$affectWordsCount<=0] <- 0
- EmpLesiontibbleLong$affectUsed <- as.numeric(EmpLesiontibbleLong$affectUsed)
- EmpLesiontibbleLong$negaffectUsed[EmpLesiontibbleLong$negaffectWordsCount>=1] <- 1
- EmpLesiontibbleLong$negaffectUsed[EmpLesiontibbleLong$negaffectWordsCount<=0] <- 0
- EmpLesiontibbleLong$negaffectUsed <- as.numeric(EmpLesiontibbleLong$negaffectUsed)
- EmpLesiontibbleLong$posaffectUsed[EmpLesiontibbleLong$posaffectWordsCount>=1] <- 1
- EmpLesiontibbleLong$posaffectUsed[EmpLesiontibbleLong$posaffectWordsCount<=0] <- 0
- EmpLesiontibbleLong$posaffectUsed <- as.numeric(EmpLesiontibbleLong$posaffectUsed)
- EmpLesiontibbleLong$combinedaffectUsed[EmpLesiontibbleLong$combinedaffectWordsCount>=1] <- 1
- EmpLesiontibbleLong$combinedaffectUsed[EmpLesiontibbleLong$combinedaffectWordsCount<=0] <- 0
- EmpLesiontibbleLong$combinedaffectUsed <- as.numeric(EmpLesiontibbleLong$combinedaffectUsed)
- #### Emotion Word Count Analysis ####
- ## Word Count Analysis (not reported in paper)
- model1_fit <- glmer(formula = affectWordsCount ~ 1 + Choice*lesionGroup + (1|id),
- family=poisson,
- data = EmpLesiontibbleLong,
- na.action=na.exclude)
- summary(model1_fit)
- # Word Used Analysis (not reported in paper)
- model2_fit <- glmer(formula = affectUsed ~ 1 + Choice*lesionGroup + (1|id),
- family=binomial,
- data = EmpLesiontibbleLong,
- na.action=na.exclude)
- summary(model2_fit)
- ## Positive Affect Word Count Analysis (not reported in paper)
- model3_fit <- glmer(formula = posaffectWordsCount ~ 1 + Choice*lesionGroup + (1|id),
- family=poisson,
- data = EmpLesiontibbleLong,
- na.action=na.exclude)
- summary(model3_fit)
- # Positive Affect Word Used Analysis (reported in paper)
- model4_fit <- glmer(formula = posaffectUsed ~ 1 + Choice*lesionGroup + (1|id),
- family=binomial,
- data = EmpLesiontibbleLong,
- na.action=na.exclude)
- summary(model4_fit)
- ## Negative Affect Word Count Analysis (not reported in paper)
- model5_fit <- glmer(formula = negaffectWordsCount ~ 1 + Choice*lesionGroup + (1|id),
- family=poisson,
- data = EmpLesiontibbleLong,
- na.action=na.exclude)
- summary(model5_fit)
- # Negative Affect Word Used Analysis (reported in paper)
- model6_fit <- glmer(formula = negaffectUsed ~ 1 + Choice*lesionGroup + (1|id),
- family=binomial,
- data = EmpLesiontibbleLong,
- na.action=na.exclude)
- summary(model6_fit)
- ## Combined Affect Word Count Analysis (not reported in paper)
- model7_fit <- glmer(formula = combinedaffectWordsCount ~ 1 + Choice*lesionGroup + (1|id),
- family=poisson,
- data = EmpLesiontibbleLong,
- na.action=na.exclude)
- summary(model7_fit)
- # Combined Affect Word Used Analysis (reported in paper)
- model8_fit <- glmer(formula = combinedaffectUsed ~ 1 + Choice*lesionGroup + (1|id),
- family=binomial,
- data = EmpLesiontibbleLong,
- na.action=na.exclude)
- summary(model8_fit)
- #### Save Environment ####
- save.image('REnvironment_EmpathyChoiceAmygdalaLesions_02.02.2026.RData')
- #### Count Words ####
- # Count number of words written by participant and choice #
- EmpLesiontibbleWide <- EmpLesiontibbleLong %>%
- dplyr::group_by(id, Choice,lesionGroup) %>%
- summarise(numWordsM = mean(numWords), numWordsSD = sd(numWords),
- affectWordsM = mean(affectWordsCount), affectWordsSD = sd(affectWordsCount),
- affectUsedM = mean(affectUsed), affectUsedSD = sd(affectUsed),
- posaffectWordsCountM = mean(posaffectWordsCount), posaffectWordsCountSD = sd(posaffectWordsCount),
- negaffectWordsCountM = mean(negaffectWordsCount), negaffectWordsCountSD = sd(negaffectWordsCount),
- affectUsedSUM = sum(affectUsed))
- # Collapse number of words written by
- EmpLesiontibbleWideR <- EmpLesiontibbleLong %>%
- dplyr::group_by(id, Choice,lesionGroup) %>%
- summarise(nAffectWord=sum(affectWordsCount>0),nposAffect=sum(posaffectWordsCount>0),
- nnegAffect=sum(negaffectWordsCount>0))
- EmpLesiontibbleWideR$propAffect <- EmpLesiontibbleWideR$nAffectWord/40
- EmpLesiontibbleWideR$propposAffect <- EmpLesiontibbleWideR$nposAffect/40
- EmpLesiontibbleWideR$propnegAffect <- EmpLesiontibbleWideR$nnegAffect/40
- EmpLesiontibbleWideR2 <- EmpLesiontibbleWideR %>%
- dplyr::group_by(Choice,lesionGroup) %>%
- summarise(meanAffect = mean(propAffect), sdAffect = sd(propAffect),
- meanposAffect = mean(propposAffect), sdposAffect = sd(propposAffect),
- meannegAffect = mean(propnegAffect), sdnegAffect = sd(propnegAffect))
- #### Supplemental Number of Words Analyses ####
- require(lme4)
- require(nlme)
- require(lmerTest)
- EmpLesiontibbleLongAmyg <- EmpLesiontibbleLong %>%
- filter(lesionGroup == 1)
- EmpLesiontibbleLongBDC <- EmpLesiontibbleLong %>%
- filter(lesionGroup == 3)
- EmpLesiontibbleLongHC <- EmpLesiontibbleLong %>%
- filter(lesionGroup == 4)
- lm1 <- lmer(numWords ~ Choice * lesionGroup + (1|id + trial), data=EmpLesiontibbleLong)
- summary(lm1)
- lm1a <- lmer(numWords ~ Choice + (1|id + trial), data=EmpLesiontibbleLongAmyg)
- summary(lm1a)
- lm1b <- lmer(numWords ~ Choice + (1|id + trial), data=EmpLesiontibbleLongBDC)
- summary(lm1b)
- lm1c <- lmer(numWords ~ Choice + (1|id + trial), data=EmpLesiontibbleLongHC)
- summary(lm1c)
- lm2a <- lmer(numWords ~ Choice + (1|id + trial), data=EmpLesiontibbleLongAmyg)
- summary(lm2a)
- lm2b <- lmer(numWords ~ Choice + (1|id + trial), data=EmpLesiontibbleLongBDC)
- summary(lm2b)
- lm2c <- lmer(numWords ~ Choice + (1|id + trial), data=EmpLesiontibbleLongHC)
- summary(lm2c)
EmpathyChoiceAmygdalaLesionsRScript_02.02.2026.R, no license · at the source
Overview
- Department of Psychology, University of Western Ontario, London, ON N6A 5C2, Canada
- Department of Neurology, University of Iowa, Iowa City, IA 52242, USA
- Department of Psychology and Rock Ethics Institute, The Pennsylvania State University, University Park, PA 16802, USA
Abstract
Damage to the amygdala has been linked to impairments in empathy, typically documented as deficits in accurately identifying others’ emotional experiences, especially fear. This has led some to theorize that amygdala dysfunction is a core feature of psychopathy. There is growing evidence, however, that motivation to empathize is distinct from empathic accuracy. Moreover, anecdotal observations in patients with amygdala lesions have noted their tendencies to approach, rather than avoid, empathic encounters with strangers, even when the patients have impairments in empathic accuracy.
We conducted a novel investigation specifically examining empathy motivation in patients with amygdala damage. We used a free-choice paradigm to assess motivation to empathize.
We found that damage to the amygdala was not associated with avoidance of affective or cognitive forms of empathy motivation. Patients with amygdala lesions (n = 21) exhibited similar levels of empathy motivation compared with patients with damage outside the amygdala (n = 22) and healthy individuals with no brain damage (n = 24).
These findings suggest that amygdala damage does not necessarily disrupt the motivation to empathize. A potential implication of the findings is that amygdala damage or dysfunction may not be associated with traits such as callousness, apathy or lack of caring that are often linked to psychopathy.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
OSF d4epm
Availability: 1 check, the latest on 28 September 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
2 files
- EmpathyChoiceAmygdalaLes
ionsRScript_02.02.2026.R , R, 713 lines - Syntax_EmpathyChoiceAmyg
dalaLesions_02.02.2026.s , SPSS, 840 linesps
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 2 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
Data, syntax and analytic code are available (https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 6 keywords, 10 MeSH terms, 6 funders, 67 references, 1 integrity notice.
Cite
This paper
Scheffer, J. A., Reber, J., Cameron, C. D., Feinstein, J. S., & Tranel, D. (2026). Empathy motivation is preserved following amygdala damage. Brain : a journal of neurology, 149(5), 1623-1634. https://
BibTeX
@article{scheffer2026emp
author = {Scheffer, Julian A and Reber, Justin and Cameron, C Daryl and Feinstein, Justin S and Tranel, Daniel},
title = {{Empathy motivation is preserved following amygdala damage}},
journal = {Brain : a journal of neurology},
year = {2026},
month = may,
volume = {149},
number = {5},
pages = {1623--1634},
publisher = {Oxford University Press},
issn = {0006-8950},
doi = {10.1093/
url = {https://
pmid = {41822985},
pmcid = {PMC13140638}
}
RIS
TY - JOUR
AU - Scheffer, Julian A
AU - Reber, Justin
AU - Cameron, C Daryl
AU - Feinstein, Justin S
AU - Tranel, Daniel
TI - Empathy motivation is preserved following amygdala damage
T2 - Brain : a journal of neurology
J2 - Brain
PY - 2026
DA - 2026/
VL - 149
IS - 5
SP - 1623
EP - 1634
SN - 0006-8950
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"type": "article-journal",
"title": "Empathy motivation is preserved following amygdala damage",
"container-title": "Brain : a journal of neurology",
"author": [
{
"family": "Scheffer",
"given": "Julian A"
},
{
"family": "Reber",
"given": "Justin"
},
{
"family": "Cameron",
"given": "C Daryl"
},
{
"family": "Feinstein",
"given": "Justin S"
},
{
"family": "Tranel",
"given": "Daniel"
}
],
"container-title-short":
"volume": "149",
"issue": "5",
"page": "1623-1634",
"DOI": "10.1093/
"PMID": "41822985",
"PMCID": "PMC13140638",
"ISSN": "0006-8950",
"publisher": "Oxford University Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1016/j.cub.2022.08.010 [code]
- Distinct neural representations for prosocial and self-benefiting effort.Journal: Current biology : CBIn common: lme4, tidyverse, 5 references
- [2] doi:10.7554/elife.78162 [code]
- Neural defensive circuits underlie helping under threat in humans.Journal: eLifeIn common: lmerTest, lme4, tidyverse, 3 references
- [3] doi:10.1093/brain/awaf056 [code]
- Ventromedial prefrontal cortex lesions disrupt learning to reward others.Journal: Brain : a journal of neurologyIn common: lmerTest, lme4, tidyverse, 3 references
- [4] doi:10.1093/pnasnexus/pgad199 [code]
- Neural responses underlying extraordinary altruists' generosity for socially distant others.Journal: PNAS nexusIn common: nlme, lmerTest, lme4, 1 other tool, 1 reference
- [5] doi:10.3758/s13415-026-01442-0 [code]
- Empathy for pain persists across live two-way video interactions and viewing of prerecorded videos.Journal: Cognitive, affective & behavioral neuroscienceIn common: lmerTest, lme4, tidyverse, cognitive, 2 references
- [6] doi:10.1371/journal.pbio.3003079 [code]
- Dorsomedial and ventromedial prefrontal cortex lesions differentially impact social influence and temporal discounting.Journal: PLoS biologyIn common: lmerTest, lme4, tidyverse, cognitive, 2 references
- [7] doi:10.1038/s41598-025-00679-y
- Childhood abuse and neglect are differentially related to perceived discrimination and structural change in empathy-related circuitry.Journal: Scientific reportsIn common: 4 references
- [8] doi:10.1073/pnas.2307221121 [code]
- Callousness, exploitativeness, and tracking of cooperation incentives in the human default network.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: lmerTest, lme4, tidyverse, cognitive, 1 reference
- [9] doi:10.1093/scan/nsag015 [code]
- Lonelier people feel less empathic despite intact neural empathy responses after meditation training.Journal: Social cognitive and affective neuroscienceIn common: nlme, tidyverse, 2 references
- [10] doi:10.1093/scan/nsac011 [code]
- Mu rhythm suppression over sensorimotor regions is associated with greater empathic accuracy.Journal: Social cognitive and affective neuroscienceIn common: lmerTest, lme4, tidyverse, cognitive, 1 reference
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 2 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:8d2879659fcae0b1…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1093/brain/awag074)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1093/brain/awag074.svg
:target: https://openscicode.org/badge/doi/10.1093/brain/awag074
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1093/brain/awag074"><img src="https://openscicode.org/badge/doi/10.1093/brain/awag074.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
