Table of Contents

A Statistical Power Analysis on Lower Limb Kinematic Comparisons Across Changing Gradients and Speeds

Abstract

An open-sourced dataset from the University of Bath including full body kinematics and ground reaction forces of fifty heterogeneous runners completing treadmill running at various speeds and gradients. This tutorial demonstrates how Visual3D, Sift and Power1D (Jiku) can be used to conduct a statistical power analysis to assess whether changing speed and gradient have a larger affect on running kinematics.

Data

Data assessed for this processing included:

The dataset can be downloaded using BathUniversity Dataset which contains a zip file for each participant with the trial .c3d files and a participant info .csv file.

Creating CMZ Workspaces in Visual3D

Step 1: Create Model

A new model was created following the recommendations from Building a 6DOF Model tutorial, which was then saved as a .mdh file. A few specific changes were made to the model that should be highlighted

Here is the model template file used in this tutorial: model.mdh

Step 2: Create a Processing Pipeline

Set up a typical processing pipeline, which can be done following the recommendations of Pipeline Overview Wiki page. The outlined pipeline highlights the commands used to process the data, which was saved as a .V3S file using the Save Pipeline As button under Pipeline

Here is the processing pipeline file used in this tutorial: Pipeline.v3s

Interpolate: add SIGNAL_TYPES to TARGET

Lowpass Filter: add SIGNAL_TYPES to TARGET and SIGNAL_FOLDER to PROCESSED

Use Processed Analog: add USE_PROCESSED to TRUE

Lowpass Filter: add SIGNAL_TYPES to ANALOG

FP Auto Baseline: add FP_NUMBER to 1+2

Modify force platform parameters: click edit and select get current C3D parameters

Recalc: default parameters

Automatic gait events: default parameters

Assign tags to file: each trial had two sets of tags applied, one for the gradient/type (uphill run, flat run, downhill run, walk) and speed (slow, norm, fixed, fast). Tags were made seperately and applied using a file mask such as *uphillrun*. This finds any .c3d files that have “uphillrun” in the file name.

Compute model based data: similar to assigning tags, computing model based data was computed individually for the left and right side as well for the metrics that you want to calculated, Add RESULT_NAME as “the name of metric” such as Left_Knee_Angle, add SUBJECT_TAG as ALL_SUBJECTS, add FUNCTION as “type of metric” such as Joint Angle (chosen from list under model based item properties), add SEGMENT as “the proximal segment” such as Left Shank (LSK) , add REFERENCE_SEGMENT as “distal segment” such as Left Thigh (LTH), add RESOLUTION_COORDINATE_SYSTEM, for left side only add NEGATEY and NEGATEZ as TRUE (as it is opposite to global coordinate system)

Save pipeline as .vs3 and save workspace .cmz

Step 3: Batch Process all Data Files through Sift's Command Line

To repeat the steps from Visual3D for all the participants, this can be completed in Sift by selecting Load Data and the correct Library path.

Each participant should have their own folder with all the .c3d files for each movement.

Another option is to build CMZ files within the command line Locate Sift within the command pipeline and then run the code below in the Sift noGUI following the Build CMZ Files Command Line

The steps for running CMZ build are:

  1. Make Hybrid Model: selects the model.mdh file, static file ID, dynamic file ID, and current file directory
  2. Add Metadata: select participant info.csv file which is used to set metrics and tags
  3. Add V3D script: selects pipeline.v3s script
  4. Build CMZ: execute file to create CMZ files for each participant
-MakeHybridModel modelTemplateFile "C:\Users\...\modeltemplate.mdh" staticFileID "*Static*.c3d" dynamicFileID "*.c3d" currentFileDirectory "C:\Users\...\FolderLocation\" -AddMetaData metaFile "C:\Users\...\Participant_Info.csv" settingsFile "C:\Users\...\participantinfo_metadata.xml" -AddV3DScript scriptFile "C:\Users\...\pipeline.v3s" -buildCMZ directory "C:\Users\...\FolderLocation\" 

Analysis in Sift

Create Queries

Once CMZ files are built, open Sift from the GUI and load the library.

Next step is to create the queries to have groups separated by trials and the link model based calculations. This will allow groups to be easily compared between different conditions and metrics.

This is done by opening the Explore tab on the left and select Query Builder. Follow along Refine Queries by selecting Auto-Populate Queries through refinements of tags. To add multiple tags within the groups, edit the conditions and go under the refinement tab to select Refine using tag and Use AND Logic and select the speed and gradient tag to create as one group.

For example, we assessed the knee joint angle in the X direction (flexion/extension) for each of the trials as separate groups. This allowed us to select multiple groups to compare either changing speed (ex. Downhill Fast, Downhill Slow and Downhill Norm) or changing gradient (Downhill Slow, Uphill Slow, Flat Slow). Each workspace within these groups represents an individual participant (CMZ file).

Here is the query builder file used in this tutorial: Queries.q3d to match the groups above.

Clean Data

In Explore tab, you can visualize your data by selecting the group of interest then selecting all workspace (button). You can also view a single workspace.

If there are any traces that appear visually as outliers, they can be removed within the graph. To clean the data, start by selecting the trial(s) that had issues and right click → Exclude Trace (raw data) to remove any incorrect trials.

Alternative anomaly and outlier detection methods can be found from the Anomaly Detection wiki page.

Once data is cleaned you can update CMZ data. This is shown through the Clean Data tutorial page to update a clean dataset. This is done by clicking the Update CMZ Files which will open this dialog:

Select Excluded Traces and Add Event to Exclude Signals which is defined as BAD. This will tag the bad data helping to exclude those signals that are defined as “BAD”. The click Run Pipeline which will update the dataset.

PCA

Once the data is cleaned up, we can finally answer our question whether there is any explanation or statistically meaningful differences across gradients and speeds. Principal Component Analysis can be used to find components within the dataset that explain variance, specially which areas show variance.

In Analysis tab, select the groups you want to compare and select PCA icon in the toolbar. Follow PCA tutorial to run analysis.

  1. Set name for PCA
  2. Set Number PCs to 3 (variance explained over 90%)
  3. Set Use Workspace Mean

Results will popup

Results of PCA can be interpreted as explained in Analysis page

SPM

Statistical Parametric Mapping is also another example of identifying regions throughout the waveform where groups or conditions that show variance, however its benefit is showing whether those regions have statistically significant differences.

Continue with analysis by selecting SPM icon in the toolbar. Follow SPM tutorial for more information

  1. Set name for GLM
  2. Use Two-Sample T-Test (comparing two independent group)
  3. Select the groups for comparison
  4. Set Use Workspace Mean

Head to Statistics and select Compute SPM

  1. Set SPM name
  2. Select Downhill_Fast as Group 1 and Downhill_Slow as Group 2 (can be interchangeable)
  3. Set Threshold to 0.05
  4. Click Two-Tailed
  5. Create SPM

Results of SPM can be interpreted as explained in Analysis page

Project Question

Does variation of speed or gradient have a larger effect on changes in knee joint kinematics?

Changing Speed - Fast vs Slow Changing Gradients - Downhill vs Uphill
Large variance in PC1 Variance in both PC1 and PC2
Highest variance at the peak flexion angle during the stance phase Highest variance during the swing phase

Changing gradients (ex. Running at slow pace uphill vs downhill) shows variance in both PC1 and PC2, while changing speed (ex. Running downhill at fast vs slow pace) shows variances in only PC1. When separating PCs using the Extreme Plot section of PCA analysis we can see PC1 explains variance in the peak joint angle, while PC2 explains phase shift

Changing Gradients - Running slow pace uphill vs downhill

PC1 PC2

Analysis in Jiku

Jiku

Although we have determined whether regions of the waveform have significant statistical differences, we can also estimate the probability that the experiment will correctly detect a true effect. This can help determine the proper sample size needed to avoid false-negative without wasting resources.

Jiku Power1D is a statistical power analysis tool for one-dimensional continuum data. It is easily integrated with Sift, allowing you to complete your analysis seamlessly. Head to https://github.com/jiku-pro/releases-power1d/releases to download Power1D.

  1. Open up Power1D
  2. Select two-sample
  3. In the Explore tab from Sift, you can move the data into Power1D by selecting the group or workspace of interest. Click Shift and Ctrl to drag the group into Group A within Jiku Power1D. Do the same into Group B with the second group of interest you want to compare
  4. Choose ImportedDatum in the dropdown selection

Head to Analysis

  1. Select Power Mode
  2. Leave Alpha at default value of 0.05. This signifies the significance level, which is the chosen risk tolerance for a false positive. This means there is an accepted 5% chance of finding a significant effect when non actually exists.
  3. Leave Iterations at 5000. This defines the number of times the computer simulator repeats a test. In each single iteration, the simulator tests both the null model (no effect) and the alterative model (true effect)
  4. Lead Seed at 0, and select Seed Lock. This is the initial number used to start the random number generator. Keeping it the same means the software will create the exact same random noise and graphs again.
  5. Change sample size mode to Absolute
  6. Use Sift Workspace to determine how many samples are used. Choose icon in Sift and change Display type for excluded data to Fraction. Add all the denominators of the fractions for each of the workspace to determine the total number of samples used.

Example. For one participant comparing running downhill at fast (Group A) vs slow (Group B) pace, Power1D will look like this. Click Run to simulate data.

This will popup Results

and Distribution

Results indicate the power at each point across the domain. Domain represents time or cycle %. Non zero power means true effect is detectable at both maximal values and neighbouring values. Omnibus power represents the probability that the null hypothesis will be rejected in a large number of experiments. This is shown as the proportion of the h1 distribution that lies above the critical value.

There are two distributions. Distribution in gray represents the null hypothesis (h0), while distribution in blue represents alternative hypothsis (h1). The distribution represents the proportion of Zmax that exceeds the critical value meaning the null hypothesis is rejected.