Return to the Weather Prediction Test page
___________________________________________________________________________________________________________________	

								WEATHER PREDICTION TEST: 
							A Probabilistic Classification Learning Task
___________________________________________________________________________________________________________________

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

Script Copyright © 01-02-2020 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________
This script implements the Weather Prediction Test , a test of probabilistic learning.

Reference:

Knowlton, B.J, Squire, L.R, Gluck, M.A (1994). Probabilistic classification learning in amnesia. 
Learn Mem, 1, 106 –120.
___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________	

Participants see combinations of 4 (weather) cue cards (Max number of cues presented at the same time: 3)
and have to predict the weather outcome (rain vs. sunshine) based on the different cue patterns
within 5s.

All cue patterns predict a weather outcome (e.g sunshine) with a predetermined probability.
There are four possible cue outcome association strengths with outcome1:
75%, 58%, 43%, or 26% (approximately) with outcome 1.
Feedback is given based on the actual weather outcome. 
Script tracks whether participants select the more probable outcome for 
the pattern (even if the less probable outcome was the actual outcome) across 7 blocks of 50 trials
as well as for every 10 trials during the first block.

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 25 minutes to complete

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

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

build:							The specific Inquisit version used (the 'build') that was run
computer.platform:				the platform the script was run on (win/mac/ios/android)
date, time, 						date and time script was run 
subject, group, 					with the current subject/groupnumber
script.sessionid:					with the current session id

blockcode, blocknum:				the name and number of the current block (built-in Inquisit variable)
trialcode, trialnum: 				the name and number of the currently recorded trial (built-in Inquisit variable)
										Note: trialnum is a built-in Inquisit variable; it counts all trials run; even those
										that do not store data to the data file such as feedback trials. Thus, trialnum 
										may not reflect the number of main trials run per block. 

values.cue1-
values.cue4:						store the itemnumber of the cues randomly assigned to be used as cue1-cue4
									
values.countTestBlock:			keeps track of the number of Test Blocks run
values.pattern:					stores the current cue pattern 
								(e.g. "1000" -> only cue1 is presented)
								
values.currentCue1-
values.currentCue4:				stores the current itemnumber of the presented cue (0 = empty)
values.P_outcome1:				stores the probability of outcome 1 associated with the current cue pattern
values.P_outcome2:				stores the probability of outcome 2 associated with the current cue pattern

values.outcome:					actual selected outcome: 
								1 = outcome1; 
								2 = outcome2 
								(assigned based on predetermined probabilities)
								
response:						the participant's response (selected response button)
latency: 							the response latency (in ms) measured from cue onset

values.correctOutcomePrediction:	1 = correct actual outcome was predicted; 
								0 = prediction was incorrect
								
values.probableOutcomePrediction:	1 = probable outcome for the pattern was predicted (=> outcome with a probability of 0.5 or above was selected); 
								0 = otherwise
									Note: responses to pattern 6 and 9 were excluded from summary variables as probabilities for either outcome was p = 0.5
									
expressions.prop_probableChoice:		proportion of more probable outcome response per block
									Note: responses to pattern 6 and 9 were excluded from summary variables as probabilities for either outcome was p = 0.5

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

computer.platform:				the platform the script was run on (win/mac/ios/android)
script.startdate:					date script was run
script.starttime:					time script was started
script.subjectid:					assigned subject id number
script.groupid:					assigned group id number
script.sessionid:					assigned session id number
script.elapsedtime:				time it took to run script (in ms); measured from onset to offset of script
script.completed:					0 = script was not completed (prematurely aborted); 
								1 = script was completed (all conditions run)

Summary Variables:
Note: responses to pattern 6 and 9 were excluded from summary variables as probabilities for either outcome was p = 0.5

prop_probableChoice_overall:			overall proportion of probable choice responses (probable choice = selecting the outcome with p > 0.5 for the given cue pattern)
prop_probableChoice_1-
prop_probableChoice_7:				proportion of probable choice responses in block 1-7

Block1: the choices of the first block are further analyzed by blocks of 10 trials:

prop_probableChoice_Block1_1to10: 	proportion of probable choice responses in block 1, trials 1-10
prop_probableChoice_Block1_11to20: 	proportion of probable choice responses in block 1, trials 11-20
prop_probableChoice_Block1_21to30: 	proportion of probable choice responses in block 1, trials 21-30
prop_probableChoice_Block1_31to40: 	proportion of probable choice responses in block 1, trials 31-40
prop_probableChoice_Block1_41to50: 	proportion of probable choice responses in block 1, trials 41-50

* 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 
___________________________________________________________________________________________________________________	

7 test blocks:
Each Block with 50 trials with pattern frequencies according to predetermined probabilities as outlined in file Probabilities.xlsx 
(also see section Editable lists list.patternFrequency)

- order of pattern is randomized with the constraint that consecutive patterns are different
- actual outcomes are determined according to predetermined outcome probabilities (not frequencies) for each pattern 
(see Editable lists list.p_outcome1 and list.outcomeprobabilities_pattern1 etc.)

- feedback based on actual prediction (NOT based on selecting the more probable outcome)

- participants have 5s (default) to respond. If no response is give within that time frame, the computer assumes the wrong prediction 
(both actual and probable) were made.

- the cue cards get randomly allocated to be cue1 to cue4 for each participant

- by default, cue positions are randomly determined (if more than 1 card)

- an optional horizontal Prediction Bar can be presented at the top of the screen:
The bar consists of a green and a red segment.
At the beginning, both segments are of equal size. The green segment
grows with each correct prediction (while the red shrinks) and it shrinks with each 
incorrect prediction (while the red on grows) throughout the task.

trial sequence:
3 cues (Max: 5000ms, response reminder after 2000ms)->Feedback based on actual prediction (2000ms) -> ITI (default: 500ms)

___________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________
provided by Millisecond Software, see section Editable Stimuli

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________
provided by Millisecond Software, see section Editable Instructions

___________________________________________________________________________________________________________________	
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:

/outcome1:					stores the itemnumber of outcome1 (here: 1 -> sunshine)
/outcome2:					stores the itemnumber of outcome2 (here: 2 -> rain)
/outcome1Label:				the label for outcome1 (default: "sunshine")
/outcome2Label:				the label for outcome2 (default: "rain")

/responseWindow:			the response window in ms (here: 5000ms)
/reminder:					the reminder delay (in ms) that reminds participants to respond (here: after 2000ms)
/feedbackDuration:			the duration (in ms) of the feedback stimuli (here: 2000ms)
/ITI:							intertrial interval in ms (default: 500ms)

/randomCuePositions:			true = cues appear with random horizontal positioning (default)
								Note: if only 1 cue card is presented, it is always presented in the center;
								the random positioning refers to trials that present more than 1 cue card.
							false = cues appear in 4 dedicated screen locations
							
/presentpredictionBar:			true = presents a horizontal Prediction Bar at the top of the screen.
							The bar consists of a green and a red segment.
							At the beginning, both segments are of equal size. The green segment
							grows with each correct prediction (while the red shrinks) and it shrinks with each 
							incorrect prediction (while the red one grows) throughout the task (default)
							false = does not present the Prediction Bar