DOI: 10.5061/dryad.dfn2z3597
title: Data from: The nasty neighbour effect in humans

description: Like other group-living species, humans often display parochial
 cooperation, that is they cooperate with ingroup members more than with
 outgroup members and strangers. Theoretically, parochial cooperation
 should imply that people also compete less with ingroup members than with
 outgroup members and strangers. However, in situations where people could
 invest to take other’s resources, and invest to protect against such
 exploitation, we observed the opposite pattern. Akin to what in other
 species is known as the ‘nasty neighbour effect’, in such dyadic contests
 people invested more (rather than less) with ingroup members than with
 out-group members and strangers across 51 nations, in different
 communities in Kenya, and in on-line samples from the United Kingdom. This
 ‘nasty neighbour’ behaviour emerged independent of parochial cooperation
 and trust towards others that have the same (versus different) nationality
 and, fitting field-observations in other species, neighbour nastiness
 emerges when people perceive within-group resource scarcity, and
 especially towards low-ranking ingroup members. That humans can exhibit
 both parochialism and nastiness within groups is difficult to reconcile
 with existing theories on the evolution of cooperation in structured
 populations.
description: # Data from: The nasty neighbour effect in humans
 [https://doi.org/10.5061/dryad.dfn2z3597](https://doi.org/10.5061/dryad.dfn2z3597) ## Description of the data and file structure This repository contains the data and code to reproduce the results of the article "The Nasty Neighbor Effect in Humans". The data are in ".Rda" format and the code was written in Rstudio. R version 4.3.1, R Studio 1.3.959 Library packages: 'metafor' (version 4.2-0), 'lme4' (1.1.-33), 'lmerTest' (3.1-3), 'countrycode' (1.5.0), 'corrplot' (0.92), 'dplyr' (1.1.2), 'data.table' (1.14.8), 'mediation' (4.5.0),  'esc' (0.5.1), 'ggplot2' (3.4.2), 'effects' (4.2-2). \########################################################################### The repository is composed by the following main dataset related to each study: data_study1.Rda, data_study2.Rda, data_study3.Rda, data_study4.Rda, return_study4.Rda, data_study5.Rda, data_study5long.Rda Other files include: all.Rda = dataset to reproduce forest plot in Figure 1 long.Rda = dataset to reproduce findings about earnings df3.Rda = dataset on country-level correlations (Figure S1) Rcode can be found in the file: 'Code_revision.R'. In the code, a description of the main variables can be found. #### Study 1 ***data_study1.Rda*** investment = conflict investments Ingr_fav = treatment variable of the ingroup vs outgroup/stranger condition Out_der = outgroup vs stranger condition country = country of the participant, "countryiso3" = country of the participant in iso3, "countriesT_iso3" = country of the opponent in the attacker-defender game in iso3 id = participant id att_def_within = attack vs defense role countriesT_iso3 = country of the opponent "Ingroup_Outgroup_Stranger": 3 level treatment variable of the ingroup vs outgroup vs stranger gender = gender of the participant age_interval: age interval Education: education levels distwces: geographical distance, distwces_s: geographical distance standardized cult_dis_complete_s = cultural distance standardized, cult_dis_complete = cultural distance GDP2019_opponent_mean = country's gdp of the opponent ***all.Rda --&gt; country level dataset*** "countryiso3...1" = country iso code 3 "Ingroup_attack" = average ingroup attack "Ingroup_defense" = average ingroup defense "OutStr_attack" = average attack between outgroup and stranger "OutStr_defense" = average defense between outgroup and stranger "Outgroup_attack" = average investment into attack against outgroup "Outgroup_defense" = average investment into defense against outgroup "Stranger_attack" = average investment into attack against stranger "Stranger_defense" = average investment into defense against stranger "Ingroup_attack_sd" = standard deviation ingroup attack "Ingroup_defense_sd" = standard deviation ingroup defense "OutStr_attack_sd" = standard deviation of the avg between outgroup/stranger attack "OutStr_defense_sd" = standard deviation of the avg between outgroup/stranger defense "Outgroup_attack_sd" = standard deviation outgroup attack "Outgroup_defense_sd" = standard deviation outgroup defense "Stranger_attack_sd" = standard deviation stranger attack "Stranger_defense_sd" = standard deviation stranger defense "Ingroup_fav_att_cor" = correlation between ingroup and out/stranger - attack "Ingroup_fav_def_cor" = correlation between ingroup and out/stranger - defense "Out_der_att_cor" = correlation between outgroup and stranger - attack "Out_der_def_cor" = correlation between outgroup and stranger - defense "sample_size" = sample size within a country ***df3.Rda --&gt; country-level dataset*** "Ingroup_fav_attack" = difference between investment in attack against ingroup vs outgroup & stranger "Ingroup_fav_defense" = difference between investment in defense against ingroup vs outgroup & stranger "globalization" = globalization index  "GDP2019" = GDP per capita "rule_of_law_2" = Rule of law indicator "government_effectiveness_2" = Government effectiveness "historical_prevalence_pathogens" = Historical prevalence of infectious diseases "Compatriotism" = compatriotism ***long.Rda*** "id" = participant identifier "countryiso3" = country code iso 3 "earnings" = earnings of the attacker defender game **Study 2** ***data_study2.Rda*** "pid" = participant id "sessioncode" = session id "role_iag" = role in the attacker defender game (attack vs defense) "tribe_relation" = variable indicating whether the two communities are characterized by conflict or not "membership_iag" = ingroup, outgroup, stranger "membership_iag2" = ingroup vs outgroup & stranger "membership_iag3" = outgroup vs stranger "iad" = conflict investments "age_interval" = age interval "gender" = gender **Study 3** "ID_num" = subject id "trans1" = conflict investment "role" = role in the attacker-defender game "contr" = ingroup vs outgroup vs stranger treatment variable "contr2" = ingroup vs outgroup & stranger variable "contr3" = Outgroup vs stranger variable "distwces" = geographical distance "distwces_s" = geographical distance standardized "cult_dis_complete" = cultural distance "age_interval" = age of the participant in intervals "Gender" = gender of the participant "perceived_status_ingroup" = perceived status within group "perceived_status_outgroup" = perceived status within outgroup "perceived_scarcity" = perceived scarcity measure "rep_concern_ingroup" = reputational concern with ingroup members "rep_concern_outroup" = reputational concern with outgroup members "Generosity_gps_1" = generosity with the global preference survey "Generosity_gps2" = generosity with the global preference survey "risk_preferences_1" = risk preferences with the global preference survey "Identity2" = social identification scale "expectations" = beliefs "similarity" = perceived similarity "perceived_competition" = perceived competition over scarce resources **Study 4** ***data_study4.Rda*** "ID" = participant id "Trust_argentina" "Trust_brazil" Trust_China" "Trust_Germany" "Trust_Indonesia" "Trust_italy" "Trust_Japan" "Trust_Korea" "Trust_Poland" "Trust_Russia" "Trust_Spain" "Trust_Taiwan2" Trust_Turkey" "Trust_UnitedKingdom" "Trust_UnitedStates" "Trust_Unknown" == variables indicating trust investments for each country "out_return" "return_uk_all" "return_unknown_all" == variables indicating return investments against outgroup, united kingdom, and unknown opponents "Arg_attack_dec_1" "Braz_attack_dec_1" "China_attack_dec_1" "Germany_attack_dec_1" "Indo_attack_dec_1" "Italy_attack_dec_1" "Japan_attack_dec_1" "Korea_attack_dec_1" "Poland_attack_dec_1" "Russia_attack_dec_1" "Spain_attack_dec_1" "Taiwan_attack_dec_1" "Turkey_attack_dec_1" "UK_attack_dec_1"  "USA_attack_dec_1" "Unknown_attack_dec_1" == variables indicating attack investments per country of the opponent "QualityCheck_2" : attention check "Arg_def_dec_1" "Brazil_def_dec_1" "China_def_dec_1" "Germany_def_dec_1" "Indonesia_def_dec_1" "Italy_def_dec_1" "Japan_def_dec_1" "Korea_def_dec_1""Poland_def_dec_1" "Russia_def_dec_1" "Spain_def_dec_1" "Taiw_def_dec_1" "Turkey_def_dec_1" "UK_def_dec_1" "USA_def_dec_1" "Unknown_def_dec_1" === variables indicating defense investments per country of the opponent **Study 5** ***data_study5.Rda*** "dec_stage2_ingroup_1" "dec_stage2_ingroup_2" "dec_stage2_ingroup_3" "dec_stage2_ingroup_4"  "dec_stage2_ingroup_5" "dec_stage2_ingroup_6" "dec_stage2_ingroup_7" "dec_stage2_ingroup_8"  "dec_stage2_ingroup_9" "dec_stage2_ingroup_10" "dec_stage2_ingroup_11" "dec_stage2_outgroup_1" "dec_stage2_outgroup_2" "dec_stage2_outgroup_3" "dec_stage2_outgroup_4" "dec_stage2_outgroup_5" "dec_stage2_outgroup_6" "dec_stage2_outgroup_7"  "dec_stage2_outgroup_8" "dec_stage2_outgroup_9" "dec_stage2_outgroup_10" "dec_stage2_outgroup_11" == punishment decision at different levels of status (outgroup 1= lowest status; outgroup 11= highest status) "ID2" participant id "FL_14_DO" == experimental treatment