Title: Functional Gait Deviation Index
Version: 0.1.0
Description: A typical gait analysis requires the examination of the motion of nine joint angles on the left-hand side and six joint angles on the right-hand side across multiple subjects. Due to the quantity and complexity of the data, it is useful to calculate the amount by which a subject’s gait deviates from an average normal profile and to represent this deviation as a single number. Such a measure can quantify the overall severity of a condition affecting walking, monitor progress, or evaluate the outcome of an intervention prescribed to improve the gait pattern. This R package provides tools for computing the Functional Gait Deviation Index, a novel index for quantifying gait pathology using multivariate functional principal component analysis. The package supports analysis at the level of both legs combined, individual legs, and individual joints/planes. It includes functions for functional data preprocessing, multivariate functional principal component decomposition, FGDI computation, and visualisation of gait abnormality scores. Further details can be found in Minhas, S. K., Sangeux, M., Polak, J., & Carey, M. (2025). The Functional Gait Deviation Index. Journal of Applied Statistics <doi:10.1080/02664763.2025.2514150>.
Depends: R (≥ 3.5.0)
Imports: ggplot2, dplyr, tidyr, Matrix, magrittr, refund,
Suggests: knitr, rmarkdown, ggpubr, gridExtra, forcats, knitr, rmarkdown,
License: GPL-3
Encoding: UTF-8
LazyData: true
VignetteBuilder: knitr
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2025-12-10 12:11:44 UTC; michellecarey
Author: Michelle Carey [aut, cre], Sajal Kaur Minhas [aut]
Maintainer: Michelle Carey <michelle.carey@ucd.ie>
Repository: CRAN
Date/Publication: 2025-12-16 14:20:02 UTC

Amputee Combined Gait Data

Description

Kinematic data for 18 individuals with unilateral above-knee amputations and 42 healthy controls. Each entry contains 18 kinematic variables measured at 1 control data precedes amputee data. Amputee data from Hood et al. (2020); control data from Fukuchi et al. (2018).

Usage

A_Data

Format

A list containing the 18 kinematic variables with each list containing a data.frame with N rows and T variables, where N is the total number of subjects and T is the total number of time points.

Left Pelvis Angles D2

numeric data.frame with N rows and T variables

Left Pelvis Angles D1

numeric data.frame with N rows and T variables

Left Pelvis Angles D3

numeric data.frame with N rows and T variables

Left Hip Angles D2

numeric data.frame with N rows and T variables

Left Hip Angles D1

numeric data.frame with N rows and T variables

Left Hip Angles D3

numeric data.frame with N rows and T variables

Left Knee Angles

numeric data.frame with N rows and T variables

Left Ankle Angle

numeric data.frame with N rows and T variables

Left Foot Progression Angle

numeric data.frame with N rows and T variables

Right Pelvis Angles D2

numeric data.frame with N rows and T variables

Right Pelvis Angles D1

numeric data.frame with N rows and T variables

Right Pelvis Angles D3

numeric data.frame with N rows and T variables

Right Hip Angles D2

numeric data.frame with N rows and T variables

Right Hip Angles D1

numeric data.frame with N rows and T variables

Right Hip Angles D3

numeric data.frame with N rows and T variables

Right Knee Angles

numeric data.frame with N rows and T variables

Right Ankle Angle

numeric data.frame with N rows and T variables

Right Foot Progression Angle

numeric data.frame with N rows and T variables

Source

Internal gait study

Examples

# Load the Data
data(A_Data)

Amputee Left-Side Gait Data

Description

Kinematic data for 18 individuals with unilateral above-knee amputations (left side only) and 42 healthy controls. Each entry includes pelvic, hip, knee, ankle, and foot angles, sampled at 1 over the full gait cycle. Amputee data from Hood et al. (2020); control data from Fukuchi et al. (2018).

Usage

A_DataL

Format

A list containing the 9 kinematic variables with each list containing a data.frame with N rows and T variables, where N is the total number of subjects and T is the total number of time points.

Left Pelvis Angles D2

numeric data.frame with N rows and T variables

Left Pelvis Angles D1

numeric data.frame with N rows and T variables

Left Pelvis Angles D3

numeric data.frame with N rows and T variables

Left Hip Angles D2

numeric data.frame with N rows and T variables

Left Hip Angles D1

numeric data.frame with N rows and T variables

Left Hip Angles D3

numeric data.frame with N rows and T variables

Left Knee Angles

numeric data.frame with N rows and T variables

Left Ankle Angle

numeric data.frame with N rows and T variables

Left Foot Progression Angle

numeric data.frame with N rows and T variables

Examples

# Load the Data
data(A_DataL)

Amputee Right-Side Gait Data

Description

Kinematic data for 18 individuals with right-side above-knee amputations and 42 healthy controls. Includes pelvic, hip, knee, ankle, and foot angles, sampled at 1 over the full gait cycle. Amputee data from Hood et al. (2020); control data from Fukuchi et al. (2018).

Usage

A_DataR

Format

A list containing the 9 kinematic variables with each list containing a data.frame with N rows and T variables, where N is the total number of subjects and T is the total number of time points.

Right Pelvis Angles D2

numeric data.frame with N rows and T variables

Right Pelvis Angles D1

numeric data.frame with N rows and T variables

Right Pelvis Angles D3

numeric data.frame with N rows and T variables

Right Hip Angles D2

numeric data.frame with N rows and T variables

Right Hip Angles D1

numeric data.frame with N rows and T variables

Right Hip Angles D3

numeric data.frame with N rows and T variables

Right Knee Angles

numeric data.frame with N rows and T variables

Right Ankle Angle

numeric data.frame with N rows and T variables

Right Foot Progression Angle

numeric data.frame with N rows and T variables

@examples # Load the Data data(A_DataR)


Metadata for Amputee Subjects

Description

Metadata for Amputee Subjects

Usage

A_data_info

Format

A data frame with the following variables:

Subject.Code

Unique identifier for each subject (e.g., TF01, TF02).

Age.yrs.

Age of the subject in years.

Gender

Biological sex (e.g., Male, Female).

Mass.kg.

Body mass in kilograms.

Height.m.

Height in meters.

Amputation.side

Side of amputation (Left or Right).

Etiology

Cause of amputation (e.g., Traumatic, Infection, Dysvascular).

Age.of.Amputation..yrs.

Age at which the subject underwent amputation (years).

K.Level

Medicare Functional Classification Level (e.g., K2, K3), indicating the subject’s mobility level.

Prescribed.Prosthesis.Knee

Type/model of the prosthetic knee prescribed (e.g., C-Leg Obk, Plie FI).

Prescribed.Prosthesis.Ankle

Type/model of the prosthetic ankle prescribed (e.g., AllPro FI, Triton Obk).

Socket.Suspension

Suspension mechanism used for the prosthetic socket (e.g., Suction, Lanyard, Pin Lock).

Training.....

Indicates whether the subject had gait training and, if so, how many sessions (e.g., “Yes (2)”, “No”).

Hand.rails.

Indicates whether hand-rails were used during gait assessment (e.g., “Yes, All”, “No”).

Examples

# Load the Data
data("A_data_info")

Compute the Functional Gait Deviation Index (FGDI)

Description

Computes univariate and multivariate FGDI scores from gait data matrices.

Usage

FGDI(G, ID, PVE_I)

Arguments

G

A list of matrices representing joint kinematic data. Each list contains the pelvic and hip angles across all three planes, knee flexion/extension, ankle dorsiflexion/plantarflexion, and foot internal/external rotation. The Left side is first and then the right side. It is important to note that since the pelvis is common to both sides, it is appropriate to include pelvic kinematics from only one side.

ID

A vector of group labels (e.g., "Case", "Control").

PVE_I

A numeric value (0–1) for cumulative proportion of variance explained.

Value

A list with the following elements:

SFGDIB

A numeric vector of scaled FGDI scores for both the left and right side.

zFGDIU

A matrix containing the standardized FGDI scores for each kinematic variable.

zFGDI

A numeric vector of standardized combined FGDI scores.

Fits

A list containing the approximated gait functions evaluated across the gait cycle for each kinematic variable.

RMSE

A numeric vector containing the root mean squared error of the approximated gait functions.

SFGDIL

A numeric vector of standardized FGDI scores for the left side.

SFGDIR

A numeric vector of standardized FGDI scores for the right side.

PVE

A numeric vector with the percentage of variation explained by FPCs for the combined data.

PVEL

A numeric vector with the percentage of variation explained by FPCs for the data on the left side.

PVER

A numeric vector with the percentage of variation explained by FPCs for the data on the right side.

UPVE

A matrix with the percentage of variation explained by FPCs for each kinematic variable.

M

The choosen number of FPCs for the combined data.

M1

The choosen number of FPCs for the data on the left side.

M2

The choosen number of FPCs for the data on the right side.

NPC

The choosen number of FPCs for each kinematic variable.

#' @examples data(A_Data) FGDI_out <- FGDI(A_Data, ID = rep(c("Case", "Control"), times = c(18, 42)), PVE_I = 0.99) FGDI_out$SFGDIL

References

Minhas, S.K., Sangeux, M., Polak, J., & Carey, M. (2025). The Functional Gait Deviation Index. Journal of Applied Statistics.


Parkinson Combined Gait Data

Description

Kinematic data for Parkinson's subjects.The PD dataset is publicly accessible, as detailed in Shida, T. K. F., Costa, T. M., de Oliveira, C. E. N., de Castro Treza, R., Hondo, S. M., Los Angeles, E., ... & Coelho, D. B. (2023).. It includes data from 21 right-handed idiopathic PD individuals. Measurements are taken at 1

Usage

P_Data

Format

A list containing the 18 kinematic variables with each list containing a data.frame with N rows and T variables, where N is the total number of subjects and T is the total number of time points.

Left Pelvis Angles D2

numeric data.frame with N rows and T variables

Left Pelvis Angles D1

numeric data.frame with N rows and T variables

Left Pelvis Angles D3

numeric data.frame with N rows and T variables

Left Hip Angles D2

numeric data.frame with N rows and T variables

Left Hip Angles D1

numeric data.frame with N rows and T variables

Left Hip Angles D3

numeric data.frame with N rows and T variables

Left Knee Angles

numeric data.frame with N rows and T variables

Left Ankle Angle

numeric data.frame with N rows and T variables

Left Foot Progression Angle

numeric data.frame with N rows and T variables

Right Pelvis Angles D2

numeric data.frame with N rows and T variables

Right Pelvis Angles D1

numeric data.frame with N rows and T variables

Right Pelvis Angles D3

numeric data.frame with N rows and T variables

Right Hip Angles D2

numeric data.frame with N rows and T variables

Right Hip Angles D1

numeric data.frame with N rows and T variables

Right Hip Angles D3

numeric data.frame with N rows and T variables

Right Knee Angles

numeric data.frame with N rows and T variables

Right Ankle Angle

numeric data.frame with N rows and T variables

Right Foot Progression Angle

numeric data.frame with N rows and T variables

Examples

# Load the Data
data(P_Data)

Metadata for Parkinson Subjects

Description

Metadata for Parkinson Subjects

Usage

P_data_info

Format

A data frame with the following variables:

ID

Subject identifier (e.g., SUB01).

Gender

Sex of the subject (e.g., M/F).

Age

Age in years.

Height..cm.

Height in centimeters.

Weight..kg.

Body weight in kilograms.

BMI..kg.m2.

Body mass index in kg/m^2.

Ortho.Prosthesis

Use of orthotic and/or prosthetic device.

Years.of.formal.study

Years of formal education completed.

Disease.duration..years.

Time since Parkinson’s disease diagnosis (years).

L.Dopa.equivalent.units..mg.day.1.

Levodopa equivalent daily dose (mg/day).

FoG.group

Classification based on freezing of gait (e.g., freezer/non-freezer).

FoG.Q..score.

Freezing of Gait Questionnaire total score.

Initial.symptoms

Initial Parkinson’s disease symptoms reported.

Is.there.a.family.history.of.PD..Who.

Family history of Parkinson’s disease and relationship.

Do.you.feel.improvement.after.using.the.antiparkinsonian.medicine.

Self-reported improvement after antiparkinsonian medication.

Have.you.ever.had.any.type.of.surgery..Which.

History of surgery and type.

Any.rehabilitation.or.physical.activity.

Participation in rehabilitation or regular physical activity.

Other.disease..cardiovascular..bone..etc..

Reported comorbid conditions (cardiovascular, bone, etc.).

Handedness

Dominant hand.

ON...Hoehn...Yahr

Hoehn and Yahr stage in the ON-medication state.

ON...MoCA

Montreal Cognitive Assessment (MoCA) score in the ON-medication state.

ON...mini.BESTest

Mini-BESTest balance score in the ON-medication state.

ON...FES.I

Falls Efficacy Scale–International (FES-I) score in the ON-medication state.

ON...UPDRS.II

UPDRS Part II (activities of daily living) total score in the ON-medication state.

ON...UPDRS.II...walking

UPDRS Part II walking item score in the ON-medication state.

ON...UPDRS.III

UPDRS Part III (motor examination) total score in the ON-medication state.

ON...UPDRS.III...rigidity

UPDRS Part III rigidity item score in the ON-medication state.

ON...UPDRS.III...walking

UPDRS Part III gait/walking item score in the ON-medication state.

ON...PIGD.or.TD

Motor phenotype in ON state: PIGD (postural instability/gait difficulty) or tremor-dominant (TD).

ON...UPDRS.III.asymmetry

Motor asymmetry index from UPDRS Part III in the ON-medication state.

ON...Stroop.I.time..s.

Completion time (seconds) for Stroop Test condition I in the ON-medication state.

ON...Stroop.I.error

Number of errors in Stroop Test condition I in the ON-medication state.

ON...Stroop.II.time..s.

Completion time (seconds) for Stroop Test condition II in the ON-medication state.

ON...Stroop.II.error

Number of errors in Stroop Test condition II in the ON-medication state.

ON...Stroop.III.time..s.

Completion time (seconds) for Stroop Test condition III (interference) in the ON-medication state.

ON...Stroop.III.error

Number of errors in Stroop Test condition III in the ON-medication state.

ON...TMTA.time..s.

Completion time (seconds) for Trail Making Test Part A in the ON-medication state.

ON...TMTA.error

Number of errors in Trail Making Test Part A in the ON-medication state.

ON...TMTB.time.s.

Completion time (seconds) for Trail Making Test Part B in the ON-medication state.

ON...TMTB.error

Number of errors in Trail Making Test Part B in the ON-medication state.

OFF...Hoehn...Yahr

Hoehn and Yahr stage in the OFF-medication state.

OFF...MoCA

Montreal Cognitive Assessment (MoCA) score in the OFF-medication state.

OFF...mini.BESTest

Mini-BESTest balance score in the OFF-medication state.

OFF...FES.I

Falls Efficacy Scale–International (FES-I) score in the OFF-medication state.

OFF...UPDRS.II

UPDRS Part II (activities of daily living) total score in the OFF-medication state.

OFF...UPDRS.II...walking

UPDRS Part II walking item score in the OFF-medication state.

OFF...UPDRS.III

UPDRS Part III (motor examination) total score in the OFF-medication state.

OFF...UPDRS.III...rigidity

UPDRS Part III rigidity item score in the OFF-medication state.

OFF...UPDRS.III...walking

UPDRS Part III gait/walking item score in the OFF-medication state.

OFF...PIGD.or.TD

Motor phenotype in OFF state: PIGD or tremor-dominant (TD).

OFF...UPDRS.III.asymmetry

Motor asymmetry index from UPDRS Part III in the OFF-medication state.

OFF...Stroop.I.time..s.

Completion time (seconds) for Stroop Test condition I in the OFF-medication state.

OFF...Stroop.I.error

Number of errors in Stroop Test condition I in the OFF-medication state.

OFF...Stroop.II.time..s.

Completion time (seconds) for Stroop Test condition II in the OFF-medication state.

OFF...Stroop.II.error

Number of errors in Stroop Test condition II in the OFF-medication state.

OFF...Stroop.III.time..s.

Completion time (seconds) for Stroop Test condition III (interference) in the OFF-medication state.

OFF...Stroop.III.error

Number of errors in Stroop Test condition III in the OFF-medication state.

OFF...TMTA.time..s.

Completion time (seconds) for Trail Making Test Part A in the OFF-medication state.

OFF...TMTA.error

Number of errors in Trail Making Test Part A in the OFF-medication state.

OFF...TMTB.time.s.

Completion time (seconds) for Trail Making Test Part B in the OFF-medication state.

OFF...TMTB.error

Number of errors in Trail Making Test Part B in the OFF-medication state.

FGDI

Freezing of Gait Diagnostic Interview score.

Examples

# Load the Data
data("P_data_info")

Plot Gait Curves with FGDI Overlay

Description

Plots gait curves comparing healthy controls to individuals with highest deviation.

Usage

plot_gait_comparison(joint_index, title, FGDI, Data, ID, combined)

Arguments

joint_index

Index of the joint angle to plot.

title

Title for the plot.

FGDI

Output list from FGDI() function.

Data

List of matrices containing the gait data.

ID

Subject group labels.

combined

Logical indicating if you want to see the combined FGDI results (TRUE). This approach yields a measure of severity by collectively considering both legs, and displays the maximum gait abnormality. If FALSE the max gait pathology is displayed for each leg individually left in green and right in blue.

Value

A ggplot object.

Examples

data(A_Data)
data(A_data_info)
ID <- c(rep("Case", 18), rep("Control", 42))
fgdi_out <- FGDI(A_Data, ID, PVE_I = 0.99)
plot_gait_comparison(1, "Pelvis Tilt", fgdi_out, A_Data, ID, combined=FALSE)