{ "cells": [ { "cell_type": "markdown", "id": "8ff591b2-52e6-4710-915b-ebaa024ec244", "metadata": {}, "source": [ "# Behaviour PLS for ERP data\n", "\n", "Here we use a single participant from the \"kiloword dataset\" ([Dufau et al., 2015](https://doi.org/10.1177/0956797615603934)) to demonstrate how behaviour PLS can be used to measure multivariate associations between ERP data and experimental covariates (in this case, various features of words presented to participants). It is valuable to compare this to the [MNE tutorial analyzing the same data using linear regression](https://mne.tools/stable/auto_examples/stats/sensor_regression.html)." ] }, { "cell_type": "markdown", "id": "98b816e9-8279-457f-bb34-362974972a1a", "metadata": {}, "source": [ "## Loading and inspecting the data\n", "\n", "The kiloword dataset ships with MNE and can be loaded as follows:" ] }, { "cell_type": "code", "execution_count": 1, "id": "382693d5-5564-493c-b4a3-a6c41665d691", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reading C:\\Users\\isaac\\mne_data\\MNE-kiloword-data\\kword_metadata-epo.fif ...\n", "Isotrak not found\n", " Found the data of interest:\n", " t = -100.00 ... 920.00 ms\n", " 0 CTF compensation matrices available\n", "Adding metadata with 8 columns\n", "960 matching events found\n", "No baseline correction applied\n", "0 projection items activated\n" ] } ], "source": [ "import mne\n", "from mne.datasets import kiloword\n", "\n", "# Load the data\n", "path = kiloword.data_path() / \"kword_metadata-epo.fif\"\n", "epochs = mne.read_epochs(path)" ] }, { "cell_type": "markdown", "id": "538bff53-1773-4069-8f1f-4c6dc72f607c", "metadata": {}, "source": [ "The `epochs` variable contains ERP data for a single participant along with metadata with various features of the words presented per trial:" ] }, { "cell_type": "code", "execution_count": 2, "id": "e09c0882-52b6-401f-b3e1-ddcfc85ed098", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | WORD | \n", "Concreteness | \n", "WordFrequency | \n", "OrthographicDistance | \n", "NumberOfLetters | \n", "BigramFrequency | \n", "ConsonantVowelProportion | \n", "VisualComplexity | \n", "
|---|---|---|---|---|---|---|---|---|
| 0 | \n", "film | \n", "5.450000 | \n", "3.189490 | \n", "1.75 | \n", "4.0 | \n", "343.250 | \n", "0.750 | \n", "55.783710 | \n", "
| 1 | \n", "cent | \n", "5.900000 | \n", "3.700704 | \n", "1.35 | \n", "4.0 | \n", "546.750 | \n", "0.750 | \n", "63.141553 | \n", "
| 2 | \n", "shot | \n", "4.600000 | \n", "2.858537 | \n", "1.20 | \n", "4.0 | \n", "484.750 | \n", "0.750 | \n", "64.600033 | \n", "
| 3 | \n", "cold | \n", "3.700000 | \n", "3.454540 | \n", "1.15 | \n", "4.0 | \n", "1095.250 | \n", "0.750 | \n", "63.657457 | \n", "
| 4 | \n", "main | \n", "3.000000 | \n", "3.539076 | \n", "1.35 | \n", "4.0 | \n", "686.000 | \n", "0.500 | \n", "68.945661 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 955 | \n", "drudgery | \n", "3.473684 | \n", "1.556303 | \n", "2.95 | \n", "8.0 | \n", "486.125 | \n", "0.625 | \n", "69.732357 | \n", "
| 956 | \n", "reversal | \n", "3.700000 | \n", "1.991226 | \n", "2.65 | \n", "8.0 | \n", "859.000 | \n", "0.625 | \n", "60.545879 | \n", "
| 957 | \n", "billiard | \n", "5.500000 | \n", "1.672098 | \n", "2.90 | \n", "8.0 | \n", "528.875 | \n", "0.625 | \n", "55.838597 | \n", "
| 958 | \n", "adherent | \n", "3.450000 | \n", "0.698970 | \n", "2.55 | \n", "8.0 | \n", "615.625 | \n", "0.625 | \n", "68.088112 | \n", "
| 959 | \n", "solenoid | \n", "4.111111 | \n", "0.301030 | \n", "3.70 | \n", "8.0 | \n", "443.250 | \n", "0.500 | \n", "64.544507 | \n", "
960 rows × 8 columns
\n", "