You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,6 +22,13 @@ Four scripts demonstrate the main use of the Toolbox:
21
22
- Development/: scripts used in testing code for bugs, including unit-tests of strategy models [toolbox functionality does not need this folder]
22
23
23
24
# How do I use the toolbox with my data?
24
-
1. Put your data into a format that can be read into a Table using "readtable" - see any of the top-level scripts for examples. For example, a CSV file. Ensure to include the command to write the Table entries as strings: readtable(<nameofyourdatafile>,'TextType','string').
25
-
2. Use Replicate_Figure1 as a template. Make a copy (e.g. My_Strategy_Analysis.m). Edit that copy to load your data (in the format of Step 1) and select the strategies you want to apply (in the string "strategues = ["go_left",...,]); then run it and see the results
26
-
3. Write your own strategy models: see the Strategy_models/ folder for examples, and a template. All strategy model functions have the same input (rows of the data Table up to the current trial) and output (the trial type as a string). Then simply add the name of the new function to your list of strategies in your script. And run it!
25
+
1. Put your data into a file format (e.g. a CSV file) that can be read into a Table using the built-in MATLAB function "readtable" - see any of the top-level scripts for examples. Ensure to include the command to write the Table entries as strings: readtable("name of your data file",'TextType','string').
26
+
2. Use Replicate_Figure1 as a template. Make a copy (e.g. My_Strategy_Analysis.m). Edit that copy to load your data (in the format of Step 1) and select the strategies you want to apply (in the string "strategies = ["go_left",...,]); then run it and see the results
27
+
3. Write your own strategy models: see the Strategy_models folder for examples and a template. All strategy model functions have the same input (rows of the data Table up to the current trial) and output (the trial type as a string). Then simply add the name of the new function to your list of strategies in your script. And run it!
28
+
29
+
# Things to be aware of
30
+
- Names and values of data variables: the supplied strategy models assume that the loaded dataset uses the following names and values for each variable: Choice ("left","right'), Reward ("yes","no"), CuePosition ("left","right").
31
+
32
+
- Omissions: the supplied strategy functions assume the subject made a choice on each trial. If your data contain trials with omissions (e.g. the subject did not engage on that trial) then either (a) remove those trials from the dataset before using the strategy analysis on them, or (b) edit the code to handle how you coded the omissions in your data. For example, if you coded an omission as Choice = NaN, then assign any trial with Choice = NaN as a "null" trial-type for *every* strategy; the best place to do that would be in the top-level script -- an if/else that checked first whether the trial was an omission, and then only evaluated the trial-type for each strategy if it was not an omission.
0 commit comments