fMRI Primer

09 Preparing Regressors

Preparing regressors from behavioral data
From E-Prime to Excel
The Mann Lab primarily gathers behavioral data during fMRI experiments using E-Prime, a stimulus presentation program. The two other programs commonly used are Presentation and Matlab: Psych toolbox. In any case, you will need to get your behavioral data into…. a matrix.

E-Prime: Open the edat file in which all the data is stored. Click the upper left hand box (the nexus of the top row and the left-most column) and the entire file, including column names, will be selected. Copy this.

Step 1: Data Storage: Open an excel worksheet, and paste the E-Prime table. The column headings will help you find what you are looking for.

Once all of the data is in Excel, you need to cull the many irrelevant columns that the edat file stores by default (though you can avoid this problem by specificying, in your E-Prime design file, only those fields that you are interested in.

In general, I recommend you keep at a minimum
1. Subject number, run number, stimulus number
2. All pertinent data about the stimulus presented – eg if it is a word, the word, if it is an image, the image name, if it varies by location, color, intensity etc, these features as well.
3. Reaction time data
4. Error data (eg, what the correct answer was and what the subject responded to)

To this data, it is helpful to add all trait data for the subject at hand. EG, subject age, gender, handedness, depression scores, date of study, and so forth.

Step 2: Data Analysis (in preparation for SPSS)

Basic data analysis can occur in Excel. In particular, you can program excel to distinguish error trials from correct trials.

Pivot Tables (wizards for these, and extensive online support as well as ‘Excel for Dummies’ type books, can help you to understand how to use them) can be used to rapidly determine such things as the average reaction time and error rate per subject per trial per stimulus type.

This information becomes the raw data for use in SPSS

– For the 4991 Study, the key data files are attached

General Layout consists of 3 basic views: When you open SPSS you get a window. At the bottom are tabs that allow different views – data and variable. The third view, syntax view, is a separate window that is generated the first time you click ‘paste’ when building an analysis

1. Data view – this is where you paste your excel data
2. Variable view – this allows you to specify each variable’s name, whether it is numeric or string, ordinal, nominal, etc
3. Syntax view. A syntax window opens when, after running an analysis, you click ‘paste’ and it puts the program in a running compilation of programs which can be saved.

– you can change the order variables appear by clicking and then dragging them up and down

Adding a New Variable

1. Go to new variable and enter it, specify qualities
2. To make a variable that is a subtraction of two others, eg C = A-B, use the transform function. Transform –> compute –> define variable; then place in new order

Selecting Certain Cases For Analysis
Data menu –> select cases….
– then follow the intuitive instructions. A diagnoal black line appears throuch all cases exculded from the analysis.

Running a program from the Syntax Editor

After using the GUI (graphical user interface) to originally program a run, you ‘paste’ it rather than clicking finish, and this allows the code to be printed in the syntax editor. This code can be modified through basic editing functions like a word document (eg fine/paste); you can also put comments in explaining what the code does. When you want to run it, you simply highlight (black) the code you want to run, and then press the Run arrow key – a little black triangle pointing to the right.

De-meaning behavioral data for use as regressors

Demeaning helps amplify signal to noise ratio. It doesn’t quite remove what is common between people (that would simply be removing the minimum score from all scores) but rather…. What?

Example: Each subject has an average reaction time to a certain class of stimuli.
Subject A: 100ms
Subject B: 150ms
Subject C: 200ms
You hypothesize that a subject’s reaction time predicts the activity of their medial PFC during the task. So you want to include their RT as a regressor. Well, guess what. You don’t just want to put 100, 150 and 200 in. You need to demean these first.

Method 1 –Subtract the lowest value from each score, EG, 100,150,200 becomes 0, 50, 100. Then subjtract the mean (50) revealing –50, 0, and 50. Then divide by the high score, EG –1, 0, 1.

Method 2 – Demean first, eg 100, 150, 200 becomes –50, 0, 50. Now divide by the NEW maximum of 50, revealing –1, 0, 1. This method is best if you think there may be deactivation of brain regions.

What if not all subjects have behavioral data for all regressors?

Do not despair. Only include those regressors any given subject has. This will make more work for you down the line, as when you run .fsf programs (FEAT in FSL) you will have to compare individual cope 3D images rather than whole .feat files.

Avoiding linear combinations

avoiding-linear-combinations-of-regressors.jpg Linear Combinations

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: