Data Processing

Setup your analysis computer.

First, install Matlab with the Signal Processing toolbox. Next, download and unpack the 'Undergrad Force analysis.zip' file and put it into your 'My Documents/Matlab' folder. These scripts are designed for use with a single force transducer, and yields the simplest (and therefore best!) measures of sensorimotor prediction. 

First time you open Matlab to use the code

Right click on the 'Undergrad Force Analysis' folder and select 'add to path -> selected folders and subfolders'. After you have done this, click the 'set path' button on the top, and choose 'Save'. You should only need to do this once.

Now you're ready to pre-process some data!

Opening your data

Copy your data from the testing computer to your analysis computer. 

in Matlab, navigate to the 'Undergrad force analysis' folder right click the 'Read_Forces_undergrad_newTrans.m'. Select 'run' from the context menu.

This will bring up a dialogue box asking you to select the files you want to analyze. Navigate to the location of your data files. Select all the data files you want to analyze by selecting the last file, holding shift, and then selecting the top file (this makes the files enter the dialogue box in the correct order). Also, you can use CTRL-A if you have nothing other than the data in your folder - any other files will kill the program.

Preprocessing your data

Once you've hit 'enter' to select your files, up will pop a window with 4 graphs (Figure 1).

Figure 1 - a classic overestimation force profile. This is typically what people do when they pick up something that looks heavier than it actually is. Note the steep rise up to the peak value for the forces, and the large single peak for the rates of change.

The red lines are the force profiles (top graphs) and the force rate profiles (bottom graphs). The blue lines are drawn to touch the peak value. Your job at this stage of the preprocessing it to make sure the correct peak has been chosen for each variable. 

By correct, I mean the peak value associated with the initial lift. This is often straightforward, but on some trials you will have to reject either (1) situations where someone bumps the transducer with their fingers before lifting, (2) trials where the subject inexplicably squeezes hard during the static holding phase (Figure 2) or (3) trials where the subject puts the object down too early with a bump. Please feel free to add screenshots of weird trials below, with comments on what you did.

Figure 2 - a situation where the incorrect peak (here, in grip force) has been picked. We care about the peak which happens at around 1 second (where the action is happening in all the other plots). You can see the re-done version in Figure 3 below.

A little side note - some scientists like to select the value of the first peak as their index of sensorimotor prediction. I prefer to select the overall peak value - it's more robust to the vagaries of experimenter interpretation (i.e., cheating) and still does the job nearly as well at a conceptual level. TL;DR - we want the largest value of grip force (GF), load force (LF), grip force rate (GFR), and load force rate (LFR) that occurs in the time just prior to the lift.

If the correct peaks have been chosen, move on to the next trial. If one of the peaks is wrong, click the Re do button to pick the correct peaks (Figure 3). Please note that you have to pick the peak for all the figures - not just the one you thought was wrong, and always in the same order (GF, LF, GFR, LFR). There's instructions at the top right of the screen - just follow them if you aren't sure. Screw this up, and you've lost that trial (until you go back and redo it later) - this isn't a disaster but it's a pain, so take you time.

Figure 3 - the same graph as above, with the correct peaks picked.

Often there isn't a right or wrong answer for 'what is the correct peak' - this is especially true of GF and LF (rates are easier). My rule here is to be consistent - pick your own internal rule of what seems like the 'real' peak, and stick with it across all subjects and all trials.

Figure 4 - a classic underestimation force profile, typical of a trial where someone lifted something which turned out to be heavier than it appeared. Sometimes making sure the correct peak is picked on these sorts of trials is tricky (see my side note above).

Once you've done all the analysis, a dialogue box will ask you where to save your output (just save it in the folder where you data files are), wait a minute, then you will see an .xls file appear.

Sorting and ordering your data

Now you're nearly ready to do some stats! First, what you need to do is paste in the trial order and input the perceptual data (type it in by hand), and calculate the z-scores. Then you need to re-order everything so that every participant has their data presented in the same order. The best way to see this for yourself is to download an example file 'Example Individual datasheet.xls' from the bottom of this page, which shows the steps you need to go through (annotations/instructions at the bottom of the sheet. Remember that raw data is sacrosanct, and you should always copy your data into to a new sheet with every step of the processing so that we can re-trace what we've done. Input the data for the perceptual ratings, and paste in the lifting order from your protocol sheets. Once you have done this for all your participants (try recording a macro if you have more than 10 people to do this for) you can paste into a single giant excel file (example of which can be found at the bottom of this page).

EXAMPLE INDIVIDUAL DATASHEET.XLS

EXAMPLE GROUP DATASHEET.XLSX