Return to the Prisoner's Dilemma Task with Reciprocity page
						
							Prisoner Dilemma Game - Reciprocity Design
SCRIPT INFO

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 01-04-2018
last updated: 02-09-2018 by K.Borchert (katjab@millisecond.com) for Millisecond Software LLC

Script Copyright © 02-09-2018 Millisecond Software


BACKGROUND INFO 

											*Purpose*
This script implements a Prisoner Dilemma Game within a reciprocity design similar to the one 
described by:

Bell R, Mieth L, Buchner A (2017). Separating conditional and unconditional cooperation in a 
sequential Prisoner's Dilemma game. PLoS ONE 12(11): e0187952. https://doi.
org/10.1371/journal.pone.0187952

Note: by default, multiple partners are used in the script


											  *Task*
Participants play an investment prisoner dilemma game. Each round they are coupled with a 
different partner (introduced via images) and have to decide to invest money into a shared
fund or not. For each investment/cooperation decision, the computer adds a certain amount of money to 
the fund (e.g. if participant decides to cooperate and invests money, the computer adds money.
If the partner decides to invest money, the computer adds additional money.). At the end of each
round the money in the shared fund gets equally divided between the two people.
Thus:
a) Partner cooperates-participant does not: participant makes net gain
b) Mutual cooperation: participant makes a net gain (as high as the incentive amount provided by computer)
c) Mutual non-cooperation: participant neither wins nor loses any money
d) Participant cooperates-partner does not: participant makes a net loss

The game is divided into two phases:
1. Exposure phase: During the exposure phase, participants get to know their different partners via their images
2. Test phase: During the test phase, participants are again coupled with the same partners as well
as a couple of new ones.


DATA FILE INFORMATION: 
The default data stored in the data files are:

(1) Raw data file: 'prisonerdilemma_reciprocity_raw*.iqdat' (a separate file for each participant)*

build:							Inquisit build
computer.platform:				the platform the script was run on
date, time, subject, group:		date and time script was run with the current subject/groupnumber 
blockcode, blocknum:			the name and number of the current block
trialcode, trialnum: 			the name and number of the currently recorded trial
									(Note: not all trials that are run might record data; by default data is collected unless /recorddata = false is set for a particular trial/block) 
/computerStrategy:				the strategy the computer uses to make its choice.
								If parameters.predeterminedExposureDecisions is set to 'true', the selected strategy is overwritten
								and the assigned values.exposureComputerDecision is used instead during the exposure phase.
								
									1 = 'cooperation': selects the cooperative strategy X on every round									
									2 = 'competition': simply defects on every round of every game by choosing the non-cooperative strategy Y
									3 = 'random': selects randomly
									4 = 'tit-for-tat': cooperates on first round then mirrors the players choices from the previous rounds
									5 = 'tit-for-two-tats': computer cooperates until 2 defects in a row and does not cooperate again until player does
									6 = 'probabilistic': cooperates on first round, then selects the strategy that is most often used by player
									(Note: if player has selected the cooperative strategy exactly 50% of the time, computer selects cooperative strategy)

/phase:							"exposure" vs. "test"
/countRounds:					tracks the number of round played per phase (resets after practice)
/partnerGender:					"female" vs. "male"
/facialExpression:				"happy" vs. "angry" (facial expression of current partner image)
/familiarity:					"old" (images used during exposure) vs. "new" (images used only during the test phase)
/faceStim:						stores the image file of the current partner
/exposurePartnerDecision:		1 = cooperative decision during exposure of this partner; 
								2 = non-cooperative decision during exposure of this partner
								"N/A" (for new items)
/previous_partnerdecision:		the partner decision from the previous round: 1 = cooperative; 2 = noncooperative								
/partnerdecision:				1 = cooperative partner decision; 
								2 = non-cooperative partner decision

/decision:						1 = cooperative participant decision; 
								2 = non-cooperative participant decision
								
/rt_decision:					latency of decision (in ms)
/countConsecutiveNonCooperative:	counts the number of consecutive non-cooperative decisions made by participant
/startBalance:					stores the balance at the start of each round
/endBalance:					stores the balance at the end of each round
/fundMoney:						stores the total money in the shared fund
/investmentAmount:				the amount (in cents) participants are asked to invest per round (default: 30cents)


(2) Summary data file: 'prisonerdilemma_reciprocity_summary*.iqdat' (a separate file for each participant)*

script.startdate:				date script was run
script.starttime:				time script was started
script.subjectid:				subject id number
script.groupid:					group id number
script.elapsedtime:				time it took to run script (in ms)
computer.platform:				the platform the script was run on
/completed:						0 = script was not completed (prematurely aborted); 1 = script was completed (all conditions run)
/computerStrategy:				the strategy the computer uses to make its choice.
								If parameters.predeterminedExposureDecisions is set to 'true', the selected strategy is overwritten
								and the assigned values.exposureComputerDecision is used instead during the exposure phase.
								
									1 = 'cooperation': selects the cooperative strategy X on every round									
									2 = 'competition': simply defects on every round of every game by choosing the non-cooperative strategy Y
									3 = 'random': selects randomly
									4 = 'tit-for-tat': cooperates on first round then mirrors the players choices from the previous rounds
									5 = 'tit-for-two-tats': computer cooperates until 2 defects in a row and does not cooperate again until player does
									6 = 'probabilistic': cooperates on first round, then selects the strategy that is most often used by player
									(Note: if player has selected the cooperative strategy exactly 50% of the time, computer selects cooperative strategy)

/predeterminedExposureDecisions:true (1) = the computer uses pre-assigned cooperation vs. non-cooperation decisions
									that are carefully balanced by gender x facial expression during the exposure phase.
									During the test phase, the computer generates the partner's decision based on parameters.computerStrategy. (default)
								false (0) = the computer generates the partner's decision based on parameters.computerStrategy
									during exposure and test phase.
							
/propCooperation:				proportion cooperation selections during the test rounds
/propReciprocity:				proportion reciprocity during the test rounds
									reciprocity = selecting cooperation during the test round for partners who
									cooperated during the exposure phase.
					
/propRetaliation:				proportion retaliation during the test rounds
									retaliation = selecting non-cooperation during the test round for partners who
									did not cooperate during the exposure phase.
									
/propReciprocity_angry:			proportion reciprocity during the test rounds for 'old' partners with angry expressions
									reciprocity = selecting cooperation during the test round for partners who
									cooperated during the exposure phase.
/propReciprocity_happy:			proportion reciprocity during the test rounds for 'old' partners with happy expressions
									reciprocity = selecting cooperation during the test round for partners who
									cooperated during the exposure phase.									
					
/propRetaliation_angry:			proportion retaliation during the test rounds for 'old' partners with angry expressions
									retaliation = selecting non-cooperation during the test round for partners who
									did not cooperate during the exposure phase.

/propRetaliation_happy:			proportion retaliation during the test rounds for 'old' partners with happy expressions
									retaliation = selecting non-cooperation during the test round for partners who
									did not cooperate during the exposure phase.									
									
/mRT:							mean decision latency (in ms) during the test phase
/mRT:							mean decision latency (in ms) during the test phase

/mRT_cooperative:				mean decision latency (in ms) of cooperative decisions during the test phase
/mRT_noncooperative:			mean decision latency (in ms) of cooperative decisions during the test phase

/mRT_reciprocity:				mean decision latency (in ms) of reciprocity decisions (see expressions.propReciprocity)
/mRT_retaliation: 				mean decision latency (in ms) of retaliation decisions (see expressions.propRetaliation)

/mRT_cooperativeAfterNoncooperative:	mean decision latency (in ms) of cooperative decisions made after the last partner made a non-cooperative decision 
/mRT_cooperativeAfterCooperative:		mean decision latency (in ms) of cooperative decisions made after the last partner made a cooperative decision 
/mRT_noncooperativeAfterNoncooperative:	mean decision latency (in ms) of non-cooperative decisions made after the last partner made a non-cooperative decision 
/mRT_noncooperativeAfterCooperative:	mean decision latency (in ms) of non-cooperative decisions made after the last partner made a cooperative decision 


* separate data files: to change to one data file for all participants (on Inquisit Lab only), go to section
"DATA" and follow further instructions


EXPERIMENTAL SET-UP

Stimuli-Assignment:
- the script automatically randomly selects 6 of each genderxemotion category to be used during the
exposure phase. 
- computer balances the number of cooperation and non-cooperation 'decisions' across genders and facial expressions

1. Exposure Phase:
- 24 trials: participant plays the game with 12 female partners (6 look angry, 6 look happy) and 12 male partners
(6 look angry, 6 look happy)
- by default, the computer assigns to each partner image its investment decision (cooperation vs. non-cooperation)
(the number of cooperation and non-cooperation 'decisions' is balanced across genders and facial expressions;
given these constraints, the assignment is randomly done for each participant)
- the order of the images is selected at random for each participant
- by default, participant is forced to cooperate during the first round

2. Test Phase:
- 36 trials: participants play the game with the 24 exposure-phase partners and 12 new ones 
(6 females: 3 happy, 3 angry; 6 males: 3 happy and 3 angry)
- the order of the images is selected at random for each participant
- by default, the investment decision of the partners is decided randomly by the computer
- by default, participant is forced to cooperate during the first round

Trial Sequence:
- presentation of current start balance (5000ms)
- presentation of current partner image and the cooperation question (until response)
- decision delay (1000ms)
- participant decision feedback (1000ms)
- partner decision delay (5000ms)
- partner decision feedback (5000ms)
- presentation of gain/loss outcome (5000ms)
- presentation of end balance (5000ms)

Round Duration (default settings): 27s + response time

STIMULI
Bell et al (2017) used the AR database: http://www2.ece.ohio-state.edu/~aleix/ARdatabase.html
This database is free to use for academic research

The stimuli used in this script are images collected from the internet and should be 
regarded as placeholders. They can be exchanged under section Editable Stimuli.

There are 4 x 9 = 36 stimuli provided.

INSTRUCTIONS
the instructions are provided by Millisecond Software. They can be edited under section Editable Instructions.
They are not original to Bell et al (2017)

EDITABLE CODE:
check below for (relatively) easily editable parameters, stimuli, instructions etc. 
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to further customize your experiment.

The parameters you can change are:
/startCapital:					the amount (in cents) participants receive at the start of the practice and test session
								(default: 100 cents)
/investmentAmount:				the amount (in cents) participants are asked to invest per round (default: 30cents)
/bonusAmount:					the bonus amount (in cents) added to the shared fund for each cooperation decision
								(either from participant or partner) (default: 10cents)

/predeterminedExposureDecisions			true (1) = the computer uses pre-assigned cooperation vs. non-cooperation decisions
											that are carefully balanced by gender x facial expression during the exposure phase.
											During the test phase, the computer generates the partner's decision based on parameters.computerStrategy. (default)
										false (0) = the computer generates the partner's decision based on parameters.computerStrategy
											during exposure and test phase.
/computerStrategy:				the strategy the computer uses to make its choice.
								If parameters.predeterminedExposureDecisions is set to 'true', the selected strategy is overwritten
								and the assigned values.exposureComputerDecision is used instead during the exposure phase.
								Furthermore, some of these strategies may not make sense given the experimental design used.
								(e.g. 'tit-for-tat' only makes sense if the same partner is used repeatedly)
								
									1 = 'cooperation': selects the cooperative strategy X on every round									
									2 = 'competition': simply defects on every round of every game by choosing the non-cooperative strategy Y
									3 = 'random': selects randomly
									4 = 'tit-for-tat': cooperates on first round then mirrors the players choices from the previous rounds
									5 = 'tit-for-two-tats': computer cooperates until 2 defects in a row and does not cooperate again until player does
									6 = 'probabilistic': cooperates on first round, then selects the strategy that is most often used by player
									(Note: if player has selected the cooperative strategy exactly 50% of the time, computer selects cooperative strategy)

/presentBalance_test:			true (1) = the balance is presented at start and end of each test trial (default)
								false (0) = the balance is not presented at start and end of each test trial
									Note: if the default is changed, you might have to change instructions accordingly
							
/presentPartnerDecision_test:	true (1) = the participant receives feedback in regard to the partner's decision (same as in practice)
								false (0) = no feedback in regard to partner decision is given during test (default)
									Note: if the default value is changed, change the instructions accordingly
Copyright © Millisecond Software. All rights reserved.
Contact | Terms of Service | Security Statement | Employment