User Tools

Site Tools


sift:tutorials:perform_statistical_parametric_mapping

Perform Statistical Parametric Mapping

This tutorial will show you how to perform an SPM analysis in Sift. An SPM analysis helps you gather statistical analysis contained in the original n-dimensional space as your data, ensuring the removal of potential biasing and allowing for easily understood visualizations. More information on SPM can be found in the SPM Page

Research Question

The question we will be trying to answer today is: “Is there a difference between how an OA patient walks and how a normal control group walks?”. We will specifically look at identifying any differences there is in the flexion-extension of the right knee for our participants.

Data

This tutorial uses overground walking data from roughly 100 subjects divided into two conditions, normal control and osteoarthritis (moderate to severe). This data set can be found in your Sift program files under “Demo” (e.g., C:\Program Files\Sift\Demo).

We will be using the same dataset as we used in the PCA Tutorial.

Set the library path to the data directory

As with previous tutorials, we begin by loading the CMZ library and defining the queries relevant to our question.

  1. Click Load Library in the toolbar to open the Load Library dialog.
  2. Click Browse and select the folder where the data is stored.
  3. Click Load button to import the data.

Define queries and calculate groups

For this tutorial we will manually create two groups based on tags, one for subjects with osteoarthritis and one for normal control subjects. We begin by defining a query for subjects with the OA tag (indicating osteoarthritis).

  1. Click on the Query Builder icon on the toolbar, or on the left panel of the Explore Page, to open the Query Builder dialog.
  2. Add a query, name it OA, and click Save.
  3. Add a condition and name it OA.
    1. Signals: Set TYPE - DERIVED, FOLDER - PCA, NAME - RKNEE_ANGLE, COMPONENT - X. This is the only signal in the data set.
    2. Events: There are no events in this data set, so this tab can be skipped.
    3. Refinements: Check the Refine using tag checkbox and select the OA tag.
    4. Click Save

Next we will define a query for subjects with the NC tag (indicating Normal Control). In this case we can easily modify our previous query rather than starting from scratch.

  1. Add a query, name it NC, and click Save.
  2. Add a condition and name it NC.
  3. In the Refinements tab, change the selected tag from OA to NC.
  4. Click Save.

You can verify here that the new NC group has the same signal and event selections as the OA group. Click Calculate All Queries and then close the Query Builder dialog.

Curve Registration

Following some of the SPM literature for Biomechanics, we recommend applying Event Registration on 1-dimensional curves, before running an SPM analysis on the data. This is because it removes time variance from our data, which has a significant impact upon the results of our time-dependent signals.

For this dataset, there are no specific event labels that we can use, but we notice a distinctive trend of a localized peak between ~50-100% of the gait cycle. As such, we will deem that as an appropriate point to register our curves to, where the right knee flexion-extension is at it's maximum. One at a time, select the query, select “Register Curves”, and add the following settings:

Where:

  1. Use the default “Name of Registration Group” (ex. OA → OA_Registered)
  2. Toggle “Use Local Max/Min” to ON.
  3. Select 50 and 100 for “Local Maximum X-Axis Range”

Select “Register” when this is complete.











You should see the registered signals “line up” much more than before registering the data:

OA Plots

NC Plots

SPM

With our pre-processing complete, we can move onto the SPM Analysis! The question we are investigating here is “Is there a difference between how an OA patient walks and how a normal control group walks?”. This is a great question to apply SPM to gain some insights.

GLM

We begin by creating a General Linear Model (GLM) of our data. This is a necessary step to easily analyze our data and create statistical parametric maps. Since we are hoping to understand the (potential) differences between 2 groups of data, we can model it by crafting the design matrix within the GLM to suit our needs. Sift automatically creates a categorical design matrix, that is, one where each grouping is selected. This will lead to a regression which calculates the means, based on these groupings. The residual matrix can then be easily calculated, and we have obtained our GLM.

This process is completed through the following steps:

  1. On the SPM tab, within the Analyse Page, select the groups and workspaces you want to include in your GLM
    1. For our analysis, select the OA and NC, and all Workspaces
  2. Select Create GLM
  3. Enter the following into the GLM Dialog:
    • GLM Name: GLM
    • Group By: Group
    • The Groups Selected should be OA and NC
  4. Select Create GLM

You will then repeat this process for the registered data:

  1. On the SPM tab, within the Analyse Page, select the groups and workspaces you want to include in your GLM
    1. For our analysis, select the OA_Registered and NC_Registered, and all Workspaces
  2. Select Create GLM
  3. Enter the following into the GLM Dialog:
    • GLM Name: GLM_Registered
    • Group By: Group
    • The Groups Selected should be OA_Registered and NC_Registered
  4. Select Create GLM

The Mapping sub-tab within the SPM Tab should now be populated, along with the charts. We can clearly see the mean signals, as well as the corresponding Residuals. We may also notice a reduction in the average residual values, indicating that our curve registration has been successful in reducing the time variation in our dataset.

Analysis

To begin creating our SPMs, we will move to the Statistics sub-tab. This is where we will run our statistical tests, and gain the real insights into our data. As mentioned, we want to understand if there is a difference in the flexion-Extension of the knee in OA patients versus a Normal Control group. A classical method of comparing 2 groups is to use the Student's t-test, which can be used to understand if the difference between 2 groups is statistically significant. Doing a t-test through SPM allows this to be extended from a single summary metric, and into a continuous statistic across the entire time domain we are analyzing.

We will perform two unpaired t-tests, comparing the registered traces to each other, and unregistered traces to each other.

To complete these SPMs:

  1. Select GLM: GLM
  2. Select Compute SPM
  3. Enter the following into the SPM Dialog:
    1. For unregistered data:
      • SPM Name: SPM
      • Statistic: t Statistic
      • Group 1: OA
      • Group 2: NC
  1. Select GLM: GLM_Registered
  2. Select Compute SPM
  3. Enter the following into the SPM Dialog:
    1. For registered data:
      • SPM Name: SPM_Registered
      • Statistic: t Statistic
      • Group 1: OA_Registered
      • Group 2: NC_Registered

We have now calculated two SPMs, which we can easily compare/contrast by selecting the GLM and SPM Results we want in the top bar of the SPM tab. Both SPMs provide us with similar insights: there is a statistical difference between the 2 groups, and it is most prominent during mid-stance(roughly 10%-25% of the gait cycle), as well as mid-swing (roughly 55%-85% of the gait cycle). For the given threshold (defaults to alpha=0.01), we have established that there is a difference between the 2 groups (more precisely, we determined that the null hypothesis that the 2 groups are from the same population sample is false at alpha<0.01).

The difference between both SPMs is most apparent at ~65% of the gait cycle. Here we can see a significantly more pronounced t statistic (~10 vs ~12.5). While both are well above the specified threshold where alpha=0.01, this can show us how curve registration can be useful to correctly align our data, and get more meaningful results from our analysis.

We should note that a similar analysis could be done (within Sift) by creating a GLM containing all 4 groups, and building similar SPMs from this. These results would not exactly match, as the test statistic uses the population level variance, which is different if all 4 groups are used together than if just 2 are.

Clearly SPM provides us more insight than just doing a t-test during an event, or at a maximum point, and can be a useful tool during the analysis phase of a biomechanics project. In this tutorial we explored what SPM means, how to create an SPM analysis in Sift, and some insight into the best practices for doing so.

sift/tutorials/perform_statistical_parametric_mapping.txt · Last modified: 2024/10/04 11:15 by wikisysop