{"id":19252262,"url":"https://github.com/sccn/eegstats","last_synced_at":"2025-08-11T18:11:06.263Z","repository":{"id":75172991,"uuid":"417708305","full_name":"sccn/eegstats","owner":"sccn","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-05T20:27:17.000Z","size":150,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T18:01:57.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sccn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-16T03:52:19.000Z","updated_at":"2024-08-05T20:27:21.000Z","dependencies_parsed_at":"2024-01-23T03:30:30.709Z","dependency_job_id":"bec5da42-8ec5-4a5b-a180-6ef5ba29748c","html_url":"https://github.com/sccn/eegstats","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Feegstats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Feegstats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Feegstats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2Feegstats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sccn","download_url":"https://codeload.github.com/sccn/eegstats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312097,"owners_count":20918341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:26:10.355Z","updated_at":"2025-08-11T18:11:06.245Z","avatar_url":"https://github.com/sccn.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EEGSTATS plugin for EEGLAB\n\nThis plugin computes frequency band power, alpha peak frequency, and alpha asymmetry. It uses the [restingIAF](https://github.com/corcorana/restingIAF) MATLAB code for some computation.\n\n## Do not download GitHub zip file\n\nYou will miss the resting IAF code dependency when downloading the zip file. Instead, download the plugin from the EEGLAB extension manager or clone the repository as indicated below.\n\n## Checkout repository\n\nMake sure to copy the submodule when you clone the repository. You may clone the repository in the **plugins** folder of EEGLAB, and the plugin will behave as if you had downloaded it from the EEGLAB plugin manager.\n\n```\ngit clone --recurse-submodules https://github.com/arnodelorme/eegstats.git\n```\n\n## Graphic interface\n\nThe plugin may be used from the command line or from its GUI. After installing the plugin using the EEGLAB plugin manager (EEGLAB menu item **File \u003e Manage EEGLAB extensions**), you may load the tutorial dataset \"eeglab_data.set\" from the \"sample_data\" folder of eeglab (or simply type \"eeglab cont\" on the MATLAB command line). Then use EEGLAB menu item **Tools \u003e EEG freq/power statistics** and following UI will pop up. In this UI, you may select frequency ranges of interest, electrodes, and other spectral parameters. You may also select to compute individual alpha frequency or alpha asymmetry between electrodes of your choice. See the [pop_eegstats.m](https://github.com/arnodelorme/eegstats/blob/master/pop_eegstats.m) header for more information.\n\n![](eegstats_gui.png)\n\nSome statistics are then shown on the command line\n\n```\nAll_channels\tFPz\tEOG1\tF3\tFz\tF4\tEOG2\tFC5\tFC1\tFC2\tFC6\tT7\tC3\tC4\tCz\tT8\tCP5\tCP1\tCP2\tCP6\tP7\tP3\tPz\tP4\tP8\tPO7\tPO3\tPOz\tPO4\tPO8\tO1\tOz\tO2\n4.0-6.0 Hz\t10.32874\t14.22889\t9.67149\t12.15102\t12.52194\t11.41491\t8.32056\t10.92951\t12.55692\t12.12547\t8.74618\t9.27780\t11.43005\t10.23406\t11.97217\t5.81186\t10.17836\t11.12828\t10.86633\t8.35843\t8.59615\t10.46200\t11.01924\t9.80405\t5.81822\t8.94987\t10.24260\t9.81776\t9.67905\t7.94379\t7.86885\t7.36514\t7.68011\n8.0-12.0 Hz\t14.34564\t12.88388\t8.29599\t14.23616\t14.09646\t13.61207\t9.33680\t12.95503\t14.09473\t13.81112\t11.21125\t11.13318\t14.51065\t14.45228\t14.24638\t7.63537\t13.54019\t15.94191\t16.27163\t12.39869\t12.74183\t16.26172\t17.82588\t15.80787\t10.10653\t14.83628\t17.25089\t17.70982\t16.13902\t13.31741\t14.39267\t14.11222\t14.18022\n18.0-22.0 Hz\t1.53140\t1.74260\t0.55711\t3.41521\t3.20146\t2.81724\t0.85928\t1.97687\t3.33149\t3.07455\t-0.56236\t-0.14296\t2.92429\t1.89127\t2.88576\t-3.66506\t0.96043\t2.88402\t2.55589\t-0.95219\t0.18848\t2.11160\t2.82488\t1.41511\t-3.05001\t1.16790\t2.55386\t1.59623\t1.61312\t-0.32435\t0.27099\t-0.79813\t-0.42993\n30.0-45.0 Hz\t-4.74193\t-3.59272\t-2.38355\t-3.85762\t-4.05003\t-4.10457\t-2.61030\t-4.35485\t-3.92142\t-4.00219\t-6.27543\t-4.97281\t-4.64989\t-5.83781\t-4.21922\t-6.76074\t-5.47909\t-5.13860\t-5.41030\t-6.93733\t-4.21273\t-5.34485\t-5.09403\t-5.76578\t-6.73008\t-3.97376\t-4.63646\t-5.62076\t-5.15805\t-5.44294\t-4.68207\t-5.68633\t-5.11051\nPeak alpha frequency\t9.68\t8.50\tNaN\t9.00\t8.50\t9.00\tNaN\t9.00\t9.00\t9.00\t9.00\t9.50\t9.50\t9.50\t9.50\t9.50\t9.50\t10.00\t10.00\t10.00\t9.50\t10.00\t10.00\t10.00\t9.50\t9.50\t10.00\t10.00\t10.00\t10.00\t10.00\t10.00\t10.00\nAlpha center of gravity\t9.36\t8.65\t8.88\t8.94\t8.87\t8.99\t8.97\t9.12\t8.99\t9.05\t9.14\t9.16\t9.45\t9.46\t9.27\t9.13\t9.44\t9.58\t9.56\t9.44\t9.32\t9.64\t9.72\t9.61\t9.39\t9.58\t9.75\t9.83\t9.70\t9.61\t9.71\t9.74\t9.73\nAlpha Asymmetry\t0.62408\n```\n\nYou can also recover these statistics using the command line call (see function help for more information):\n\n```matlab\n[power, iafSum, iafChan, freqs] = pop_eegstats(EEG, 'thetarange',[4 6] ,'alpharange',[8 12] , ...\n            'otherranges',[18 22;30 45],'averagepower','off','channels','','winsize',2, ...\n            'overlap',1,'iaf','on','iafminchan',1,'alphaasymmetry','on','asymchans','F3 F4', ...\n            'csvfile','save_these_results.csv');\n```\n\n## Group analysis (beta)\n\nThe **EEG.etc.eegstats** structure contains the saved EEG spectral statistics. Assuming you have created an EEGLAB study (requires EEGLAB 2024.0 or later version), you may compute EEG statistics on all the datasets (the plugin is compatible with processing an entire EEGLAB STUDY). Then, from the EEGLAB command line, you may recover specific fields for all datasets. You can use the ***std_readdata*** function to read the data from all datasets (this uses the default STUDY design in STUDY.currentdesign -- otherwise, you can also specify the design when calling the ***std_readdata*** function by setting the 'design' parameter).\n\n{% raw %}\n```matlab\n[STUDY,aa,xvals,~,~,~,~,info] = std_readdata(STUDY, ALLEEG, 'customread', 'std_readeegfield', ...\n                          'customparams', {{ 'etc', 'eegstats', 'alpha_asymmetry' }}, 'ndim', 1);\n```\n{% endraw %}\n\nThen you can perform statistics using EEGLAB building functions. \n\n```\n[~,p] = std_stat(aa, 'groupstats', 'on'), % perform some statistics based on the current STUDY design\n\np =\n\n  1×1 cell array\n\n    {[0.0345]}\n```\n\nOr convert the data to a table, and perform statistics using MATLAB statistics toolbox or using external software. The table below was obtained by applying these commands to a subset of the STERN EEGLAB STUDY available on this [page](https://eeglab.org/tutorials/tutorial_data.html)\n\n```matlab\nres = std_cell2table([], [], aa, info, 'design', STUDY.design(2),  'dimensions', {'subjects' 'alpha_asymmetry' })\nwritetable(res, 'mydata.csv'); % this writes the data to disk\n\nres =\n\n  4×3 table\n\n     condition      subjects    alpha_asymmetry\n    ____________    ________    _______________\n\n    {'ignore'  }       1            -1.4385    \n    {'ignore'  }       2              1.882    \n    {'memorize'}       1            -1.1305    \n    {'memorize'}       2             1.9947    \n```\n\n\n## Version history\n\nv1.4 - allowing to use median instead of mean; providing labels for all freq. bands\n\nv1.3 - update pop_eegstats.m header\n\nv1.2 - better STUDY support\n\nv1.1 - better output formating and saving results in EEG structure\n\nv1.0 - initial version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Feegstats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsccn%2Feegstats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Feegstats/lists"}