Importing, Plotting, Fitting, and Exporting Data

This step-by-step tutorial teaches you how to import, plot, fit and export data collected during an experimental session.

To fully appreciate this tutorial, we recommend to run beforehand a session for one or several experiments provided in the Storage area of the Designer panel (Demos, Examples & Tutorials folder), for example the measurement of contrast sensitivity as function of spatial frequency (found in the folder Tutorials/Contrast Sensitivity/Effect of Spatial Frequency) since this is the example used across this tutorial.

Difficulty: 3/5
Duration: 30 mn

Introduction

To start, click on the Plotter icon in the toolbar. This opens the Plotter Panel as shown below. The Plotter Panel presents several sections:

1) a hierarchical table that lists the results of the most recently performed or imported sessions,

2) a graphing view where selected datasets are plotted,

3) a Data Analysis palette that provides various ways to customize how the data are plotted or fitted,

4) a button labelled Data Table that can reveal a drawer containing the data attached to the current selection in the hierarchical table (1).

Step 1: Importing the Data

The hierarchical table (1) usually contains the session results collected since the last launch of Psykinematix. To access results from previous sessions, import them using the '+' button below the table: this can be also performed using the Plot button from the Subjects panel (see the Managing Subjects, Groups and Sessions tutorial).

Upon clicking on the '+' button, you are shown a file selection panel that allows you to select which data file to import into the Plotter table. These files have a 'dpkmx' extension and are located in the folder where your session data are stored ('~/Desktop/MyExperiments' by default).

Select a data file and click on the Open button.

Each new entry in the table provides a summary of the session information consisting of:

- Experiment ID and title
- Subject and group names
- Session index and date

This is the first level of the results hierarchy. Click on the arrow in front of the session entry to reveal the next level.

The second level of the results hierarchy displays the datasets for each experimental condition collected during the session. Each entry at this level provides a summary of the dataset consisting of:

- Method and procedure
- Condition
- Independent variables associated with the condition

In the provided example (based on the Contrast Sensitivity: Lesson 2 tutorial), the procedure (task) consisted in discriminating between vertical and horizontal gratings and multiple staircase methods were run interleaved to measure a contrast threshold for different spatial frequency conditions (sf = 0.5, 1, 2, 4, 8, 16).

Click on the arrow in front of a dataset entry (for example a staircase method) to reveal the next level.

The third level of the results hierarchy displays the individual data collected during the session. The nature of the data is explicitly described by their titles, in this example each aspect of the staircase method that varies across the collected trials.

Tip: You want to remove any data entry from the table (at any level of the hierarchy), select it and click on the '' button. Note that the file that actually stores the data is neither deleted nor modified. Data can be added to the table again at any time with the '+' button.

Step 2: Plotting the Data

1) The selected data in the third level of the hierarchy described above is automatically plotted in the graphing view with the appropriate axes, labels, and legends.

2) You can customize the graphical represenation of the selected dataset by clicking the "Data Settings" button (left one) to access the Data Analysis palette (3) or the "Graph Settings" button (right one) to access the Graph Properties palette (4).

3) The Data Analysis palette on the right side of the results table provides some data analysis options specific to the method or procedure used to collect the plotted dataset. For example, as illustrated here for some staircase dataset, it is possible to select whether an arithmetic or geometric mean is used, or whether troughts or/and peaks of the reversal data points are considered to estimate the displayed threshold. For a procedure or when selecting the first level of the hierarchy, you may get access to fitting options as well (see next section for more details). Note that the available options are automatically selected based on the selected dataset.

4) The Graph Properties palette provides many options to customize the graph.

Title, x-axis, y-axis and other properties can be customized as desired and personalized styles can even be created to re-apply the same graphing properties to other datasets.

The graph can either be printed, copied, or saved to a file by control-clicking inside the graphing view. A copied graph can be pasted into any document that supports the PDF format. A saved graph is also in PDF format and can be edited in any application that can manipulate this format.

Step 3: Fitting the Data

For methods that do not already perform some sort of data analysis, their dataset can be fitted with a psychometric function selected in the Performance or RT tab panel depending on the type of the selected data.

For methods that provide performance measurements as function of some dependent variable it is possible to fit one of the standard psychometric functions from the "Performance" tab. For a method of constant stimuli for example, it is possible to refit the data with a function different from the one specified in the properties panel of the method.

 

If reaction times (RTs) are collected during a session, their distribution is represented as a histogram whose bin width can be specified here. The original RTs can also be filtered to discard values which are too short or too long before drawing and fitting the histogram. Optionally, the histogram can be fitted with a Weibull distribution and the post-stimulus RTs can be included in both the histogram and fit.

When selecting the first level of the hierarchy and if performing some psychometric measurements (e.g. contrast thresholds) as function of some independent variable (e.g. spatial frequency), the data are automatically plotted and the "Results" tab give the ability to fit them with some built-in or customizable models (e.g. wih a contrast sensitivity function as illustrated).

The fitting procedure can be further improved from the "Fit..." tab where you can select the fitting method, weighting style, reported goodness of fit, returned precision of parameter estimation, and number of bootstrap samples. Note that using any of these fitting options requires to press the "Start" button to carry out the improved fitting procedure which, depending on the selected options and model complexity, may take from several seconds to several minutes to perform.

Step 4: Exporting the Data

Clicking on the small arrow in the bottom left-hand corner reveals a drawer with a table representation of the data. The data presented in this table depends on the selection in the hierarchical session table (1).

Selecting a session entry (1st level of the results hierarchy) shows a summary of the analysis performed on each dataset (typically thresholds and/or slopes as a function of the experimental condition). The result type is indicated by the "tab" title: in this example contrast thresholds were measured (as mean and std) for 6 experimental conditions to look at the effect of spatial frequency.

In this example, RTs were also collected and the statistics of their distribution reported as mean, median, and std for each type of response (hit & miss) including and excluding post-stimulus RTs ('All RTs' and 'Stimulus RT' extent, respectively).

This is an example of a data table obtained by selecting a dataset entry (2nd level of the results hierarchy): each data type collected during the session for a particular experimental condition appears as a column, with one row for each trial.

By control-clicking inside the table, presented data can either be printed, exported to a tabulated text file, or opened in Excel or Numbers applications for further analysis.

Conclusion

In this tutorial, you learned how to import and inspect previously collected session data, plot them with their fitting function, and export them in various forms.

Back to Tutorials

© 2006-2024 KyberVision Japan LLC. All rights reserved.