33  PsychoPy output files

PsychoPy output files contain information about the experiment, including response times and accuracies for each trial. You need these files to statistically analyse the data, which will be our focus in the upcoming labs.

Note

The most important rule first: Never ever edit an original PsychoPy output file. Instead, make a copy and edit the copy. If you follow this basic rule, nothing terrible can happen.

Why should you not edit the original output files? The output files contain your raw data. You must not modify your raw data. If you still have your raw data, whatever goes wrong later in the analysis process, you will always be able to start from scratch.

33.1 Location of output files

PsychoPy puts output files in a folder called data.

  • The data folder is automatically created when you first run an experiment.
  • The data folder is located in the same directory as your experiment .psyexp file.

For each participant, there will typically be three types of files in this folder: .csv, .log and .psydat files. We will only focus on the .csv files. CSV stands for comma separated values.

33.2 Output file name

By default, this is how the output file name is constructed: <participant_ID>_<experiment_name>_<date>_<time>.csv (where the text between the angle brackets is a place-holder for the actual values)

The participant ID is what was entered in the participant field of the info dialogue. The experiment name can be found under Experiment settingsBasicExperiment name. By default, this will be the name under which you saved your experiment.

You can change this output file naming convention under Experiment SettingsDataData filename. Some knowledge of Python is required to change this though.

33.3 Output file columns

You can find the following information in the output file columns:

  • All the information from the input file.
  • Information from the start-up dialogue window (e.g., participant ID).
  • Information associated with your Keyboard components:
    • Key pressed: <name_of_your_keyboard_component>.keys
    • Response time: <name_of_your_keyboard_component>.rt
    • Accuracy: <name_of_your_keyboard_component>.corr (this column will only exist if you used “Store correct”)
  • Information about the loops:
    • Separate loops are associated with separate columns in the output file.
    • The header of these loop-specific columns will start with the name of the loop, e.g. trials.
    • Each loop will have the following columns associated with it:
      • <loopName>.thisRepN: How often has this loop been run?
      • <loopName>.thisTrialN: What is the trial number in this loop? (Resets when the loop repeats.)
      • <loopName>.thisN: What is the overall trial number? (Does not reset when the loop repeats.)
      • <loopName>.thisIndex: The line number in the input file that was used to run the experiment.
    • You will not usually need information from these columns, but they are useful for identifying loops in the output file. Here is a simplified representation of how loops can be identified in output files:

  • Information about the onset and offset of components:
    • .started: Onset time in seconds (relative to the start of the experiment).
    • .stopped: Offset time in seconds (relative to the start of the experiment).
    • Again, you will not usually need information from these columns.
  • In addition, there will be columns for date, frame rate, experiment name and PsychoPy version. You will usually not need to look at these columns.

33.4 Output file rows

Apart from the header, each row in the output file corresponds to one trial. Rows are ordered chronologically (i.e., from first to last trial).

Note the following key details:

  • Counting in PsychoPy (as in Python) starts with 0. Thus, the first trial will have the number 0, not 1.
  • All times are in seconds. For example, a response time of 0.581 means that the response time was 0.581 seconds or 581 milliseconds (ms).