Appendix N — chapter4.analysis.statistical_tests

chapter4.analysis.statistical_tests

Provides functions to compute statistical tests to determine the significance of the obtained results.

Functions

Name Description
compare_distribution_with_zero Statistically compares the mean of a distribution with 0 using a T-test (normal data) or a W-test (non-normal data).
compare_rmse_distributions Statistically compares the RMSE of two distributions using a two-sample T-test (normal data) or a MWU test (non-normal data).
compare_splitting_approaches Statistically compares the two splitting approaches on smartphone and smartwatch data. More concretely,
compute_icc Computes the Intraclass Correlation Coefficient (ICC) between the TUG results obtained by the system and

compare_distribution_with_zero

chapter4.analysis.statistical_tests.compare_distribution_with_zero(distribution)

Statistically compares the mean of a distribution with 0 using a T-test (normal data) or a W-test (non-normal data).

Parameters

Name Type Description Default
distribution list[float] array of numbers constituting the distribution. required

Returns

Type Description
float P-value of the test. A value less than 0.05 indicates a significant difference between the distribution mean and zero.
bool Indicates if the distribution is normal or not and, therefore, which statistical test was used.

compare_rmse_distributions

chapter4.analysis.statistical_tests.compare_rmse_distributions(errors_df)

Statistically compares the RMSE of two distributions using a two-sample T-test (normal data) or a MWU test (non-normal data). The compared distributions are the inter-subject RMSE of the TUG duration and each subphase.

Parameters

Name Type Description Default
errors_df pandas.DataFrame DataFrame containing the error in ms of the system measures and the reference method for all subjects. required

Returns

Type Description
pandas.DataFrame DataFrame containing the tests results of comparing each measure (i.e., TUG duration and subphases).

compare_splitting_approaches

chapter4.analysis.statistical_tests.compare_splitting_approaches(reports, metrics)

Statistically compares the two splitting approaches on smartphone and smartwatch data. More concretely, determines if there is a significant difference in the accuracy of the models or the F1-score of the TURNING, SITTING_DOWN and TURN_TO_SIT activities.

Parameters

Name Type Description Default
reports dict Model reports. required
metrics list[str] Performance metric to compare. required

Returns

Type Description
pandas.DataFrame DataFrame containing the statistical test results.

compute_icc

chapter4.analysis.statistical_tests.compute_icc(system_results, manual_results, labels, icc_type='ICC2')

Computes the Intraclass Correlation Coefficient (ICC) between the TUG results obtained by the system and the reference methods for each TUG measure.

Parameters

Name Type Description Default
system_results list[pandas.DataFrame] Contains the DataFrames with the measures generated by both system’s configurations. required
manual_results pandas.DataFrame DataFrame containing the measures generated by the reference method. required
labels list[str] Text labels associated with the DataFrame in system_results. required
icc_type str Type of ICC to compute. One of: ICC1, ICC2, ICC3, ICC1k, ICC2k, ICC3k. 'ICC2'

Returns

Type Description
pandas.pandas.DataFrame DataFrame containing the ICC results for each TUG measure and system (C1 and C2).