## ANALYSES AND FIGURES FOR THE MANUSCRIPT ENTITLED 'STATUS, RIVALRY AND ADMIRATION-SEEKING IN NARCISSISM AND DEPRESSION', Anna Szucs, Katalin Szanto, Jade Adalbert, Aidan G. C. Wright, Luke Clark, Alexandre Y. Dombrovski (https://doi.org/10.31234/osf.io/mxve9)
## The script follows the organization of the manuscript
## Last updated Augsut 10th 2020


The data is uploaded in two datasets: a long-format one (ds_pooled.csv) employed in the trial-by-trial regression models and a wide-format one for supplemental subject-level analyses (ds_pooled_wide.csv). The .R script contains code to further generate separate datasets for Samples 1 and 2 in both the long- and the wide-format. Please, refer to the manuscript for detailed information about how the data has been collected and analyzed.

Note: The ds_items.zip file contains datasets with item scores of the included psychometric scales (trait-dominance, narcissism scales and depression scales). These files are only used in a short section of the script to compute reliability coefficients.


#########################
####### GLOSSARY ########
#########################

## subject-level variables 
##########################
# subject = participant's ID
# sample = categorical variable indicating to which sample the participant's belongs (sample 1 = Vancouver - psychology undergrads, sample 2 = Pittsburgh - majoritarily depressed elderly)
# age = participants' age when playing the task
# sex = participants' sex, categorical variable with levels 'male', 'female'
# education = years of education (assumed to be 13 for all undergrads in Sample 1)
# household_income = ranked variable (see Supplemental Table S1 for ranks), used in Sample 1 and the pooled analysis
# household_income_s2, household_income_s2_log = household income in dollars in the Pittsburgh sample; the log-transformed variable was used in analysis
# gameExp = experience with video games on computers (question built in the task's introduction section), smart phones and tablets (continuous variable with range 1 = 'played < 5 times/lifetime' to 5 = 'plays weekly')
# pointSteal_taskmean = task-level mean point stealing
# rankBuy_taskmean = task-level mean rank buying
# race = categorical variable, with categories 'Asian', 'African-Canadian or African-American', 'Caucasian', 'Other'
# stereotypical_resp = true/false variable indicating whether responses were stereotypical (i.e. unvaried) on both point stealing and rank buying 
# qMot1 to qMot8 = end-game motivation questions (see Supplemental Figure S7 for more details)
# qA1control, qA2fair, qA3enjoyed, qA4satisfied = end-game appreciation questions (see Supplemental Figure S7 for more details)
# dass21_depression = DASS21 depression subscale (collected in Sample 1)
# HRSD = Hamilton Rating Scale for Depression (collected in Sample 2)
# depression_percentile = percentile norms based on dass21_depression and HRSD scores in resp. Sample 1 and Sample 2 (used in pooled analysis)
# group_dep = participants' group attribution to healthy or depressed study groups in Sample 2, upon recruitment for a larger study (attribution to the clinical group is based on a baseline HRSD >=14 and does not necessary match participants' HRSD score at the time of the task)
# ffni_total and ffni_... = Five-factor Narcissism Inventory (FFNI) total scores and subscales
# bpni_total and bpni_... = Brief Pathological Narcissism Inventory (BPNI) total scores and subscales
# ipip_total = trait dominance measured by the International Personality Item Pool – Dominance Subscale (this scale was only collected in Sample 2)

## trial-level variables
########################
#trial = measures time on task (total task = 24 trials)
#scoreDiff = absolute score difference between the participant and their opponent on a given trial (predefined, pseudorandom variable)
#closerun = based on scoreDiff : 1 = tight competition (close-run; if scoreDiff =< 2), 0 = large score difference between participant and opponent (displayed to players during the snake arcade game for the last 10 seconds of the game).
#outcome = the trial's outcome. 0 = defeat, 1 = victory (predefined, pseudorandom variable comprising 2/3 of defeats)
#oppScore = the opponent's score on a given trial (computed on each trial as snake_score +/- scoreDiff based on the predefined outcome)
#oppRank = opponent's rank ranging from 200 = lowest to 1 = highest rank
#oppRank_inv = opponent's rank inverted, with 1 = lowest and 200 = highest rank (the inverted ranks are used in the analysis)
#rankStart = participant's rank at after learning the outcome of a given trial but before buying rank
#rankEnd = participant's rank after buying rank at the end of the trial
#rankEnd.lag1 = participant's rank when entering a given trial
#snake_score = participant's score on the snake arcade game (number of 'apples' eaten by the snake in 20 seconds)
#pointSteal = point stealing ranging from 1 = no point stealing to 5 = stealing ten points
#rankBuy = rank buying ranging from 1 = no rank buying to 5 = buying 5 extra ranks
#..._pmcentered = person-mean centered variables
#....lag = lagged variable (displays its value from the previous trial)