tramarobin / fctSnPM

Using spm1d package (v.0.4.3), compute anova and post-hoc tests from anova1 to anova3rm, with a non-parametric approach (permutation tests)
GNU General Public License v3.0
2 stars 2 forks source link

fctSnPM DOI View fctSnPM on File Exchange

Using spm1d package (v.0.4.3), computes ANOVA and post-hoc tests from anova1 to anova3rm, with a non-parametric approach (permutation tests). The type of ANOVA (if required) and post-hoc tests are chosen regarding the independent or repeated measure effects given in parameters. The function automatically adapts to 1D and 2D data.

Make sure you have the last update released on July 4th, 2023.

The general usage is:

snpmAnalysis=fctSnPM(data, independantEffects, repeatedMeasuresEffects, varargin)

Table of contents

Warnings

Caution

Statement of need

Most of physiological data measured during human movement are continuous and expressed in function of time. However, researchers predominantly analyze extracted scalar values from the continuous measurement, as the mean, the maximum, the amplitude, or the integrated value over the time. Analyzing continuous values (i.e., time series) can provide more information than extracted indicators, as the later discards one dimension of the data among the magnitude and localization in time. In addition, oscillatory signals such as muscle vibrations and electromyograms contain information in the temporal and frequency domains. Once again, scalar analysis reduces the information at only one dimension by discarding two dimensions among the magnitude and the localization in the time and/or frequency domain.

Factorial SnPM (fctSnPM) allows MATLAB users to create figures of 1D and 2D SnPM analysis for ANOVA and post-hoc designs. The statistical analysis is also saved in .mat files.
This function synthetizes the main and interaction effects to display only the significant post-hoc regarding the results of the ANOVA.
For post-hoc for interaction effects, the main effect is also displayed if located elsewhere than the interaction effect.

Citing fctSnPM

MATLAB Release Compatibility

Compatible from Matlab R2017b

Outputs

snpmAnalysis

snpmAnalysis.mat is a structure composed of the results of the statistical analysis (ANOVA + Post Hoc).

snpmAnalysis.anova is composed of different fields:

clusterLocation and clusterP are created only in one dimension

snpmAnalysis.posthoc is a strucure of cells (one for each effect of the ANOVA) composed of different fields:

For the following outputs, the number of cells of the structure correspond to the number of t-tests performed, one t-test corresponds to one cell.

Figures

Two folders composed of figures in .TIF and .fig are created

ANOVA

Each effect is also display on a specific figure in .TIF format named after effectNames, a floder named FIG is also created and contains the figures in .fig format.
For 1D: The curve represents the Fcontinuum, the horizontal line is the Fthreshold, the highlighted parts of the curve in blue represents the significant cluster(s), and the vertical lines are the start and end indexes. For 2D: The map represents the Fcontinuum, with a colorbar maximum at Fthreshold, the white clusters represent the significant clusters.

Post Hoc

This folder contains additional folders (0 (for anova1), 3 (for anova2) or 7 (for anova3)) that contain figures and metrics representing the different post-hoc tests.

Interaction folders (AxB or AxBxC) contain 2 or 3 folders in which one effect is investigated.

In one dimension

A total of 5 figures with the name of the effect represent the means and standard deviations between subject for each condition (grouped in function of the effect investigated).
Under this plot, a second graph display the result of the ANOVA (or ANOVAs for interaction) and the significant post-hoc tests for pairwise comparisons.
The differences between the 5 figures are the representation of the ANOVA and the disposition of the statistical analysis (subplot or same plot, see optional inputs)

Subfolders: Contains the pairwise comparison results

In two dimensions

Means maps for each condition are represented in one figure each. The global effect of the post hoc procedure is display on a figure with the name of the effect. Mean maps are represented on the diagonal, pairwise differences on the top-right panel, and pairwise SnPM inferences on the bottom-left panel.

Subfolders: Contains the pairwise comparison results (In one folder for ANOVA1, in 2 or 3 folders for ANOVA2 and ANOVA3)

Examples

In one dimension

The output of D1_ANOVA2_1rm.m for a 2way ANOVA with 1 repeated measure in 1 dimension in the Examples folder is as follows The curves represent the ratio between Quadriceps and Hamstrings during isokinetic tests for two sides (Left and Right) and for two sexes (M and F).

ANOVA results: There is a "Side" effect, with a F-value above the significant threshold of 7.14 between 30 and 85°. alt text

Post-hoc results: The curves represent the means and the standard deviations. Right > Left between 30 and 85°. The significant differences are displayed below the curves using the curves to display the pairwise comparisons. The ANOVA results are also displayed if wanted. alt text

In two dimensions

The output of D2_ANOVA2_2rm.m for a 2way ANOVA with 2 repeated measures in 2 dimensions is as follows The maps represent the time-frequency analysis of vibratory signal quantified with two devices (ACC and US), and for two muscle activations (Relaxed and Contracted).

ANOVA results: Red clusters circled in white are the zone of significant effects. There are mains and interaction effects. alt text

Post-hoc results for main effects: Mean maps for each condition are displayed. Statistical results are shown within each map of differences on the top (Device effect) and at the bottom (Activation effect). The significant cluster are circled in white. alt text

Post-hoc results for interaction effects: Mean maps for each condition are displayed. Statistical results are shown within each map of differences on the right (Activation effect) and at the bottom (Device effect). The significant cluster are circled in white. Note that the main effects are also displayed. alt text

Using fctSnPM

Installation

Install this package by adding the src directory and its subdirectories to the MATLAB path. One way to do this is to call: addpath(genpath("./fctSnPM/src")), where ./fctSnPM/src is the full path to the src directory. Refer to the MATLAB documentation regarding search paths for alternative ways to set the path for current and future sessions.

Usage

snpmAnalysis=fctSnPM(data, independantEffects, repeatedMeasuresEffects, varargin)

Obligatory inputs

Optional inputs

Optional inputs are available to personalize the figures.

snpmAnalysis=fctSnPM(data, independantEffects, repeatedMeasuresEffects, 'Optional Input Name', value)

Utilities

These options act on the name of the created folders.

Statistical parameters

These options act at a statistical level, modifying the alpha error or the number of permutations.

General plot parameters

These options can modify the general aspect of the figures for 1D and 2D.

2D plot parameters

These option are specific to 2D plots.

1D plot parameters

These option are specific to 1D plots.

Optional functions

in addition of fctSnPM, this repository contains two similar funtions.

The general use of these funtions are:

snpmAnalysis=fctSnPMS(data, independantEffects, repeatedMeasuresEffects, 'Optional Input Name', value)
onlyPlot(snpmAnalysis,'Optional Input Name', value)
saveNplot(snpmAnalysis,'Optional Input Name', value)

You can use onlyPlot to have an insight on the figures before saving to adjust the plot parameters.
It may be useful to use saveNplot when a 2D analysis is performed, it may permit to redo quickly figures without the long time of analysis.

Community guidelines

You can create a new issue in the Issues section of this repository to:

I will try to answer as quickly and accurately as possible. Thank's for using this function.