JKDataAnalysis / BalanceAnalysis

Analysis of human static balance data
1 stars 0 forks source link

Balance Analysis

This code runs analysis on human balance data providing various parameters relating to the centre of force movement. The following parameters will be saved as a csv file;

Handling missing data

If there may be frames of data missing from the time serires, there is also the option to return an analysis of these and optionally interpolate the gaps.

Frame gap analysis

If 'fgap' is set to 'T' (TRUE) in settings, these data will be included in the results saved to .csv file separated by an empty column headed 'FrameGaps'. The following columns contain counts of gaps in the time-series of the indicated number of frames. By calling the main function as (run_it(miss = TRUE), data describing the profile of missing data will be calculated. These are exported as a text file as well as creating global variables. These are used by the FrameSkippingErrorAnalysis script and further details can be found in the guide for this.

Interpolation

Gaps in data can optionally be interpolated using splines (using the na. spline function from the zoo library). Whether interpolation is to be used prior to analysis can be set in the analysis specifications file. It is possible to run the analysis both with and without interpolation of missing data. See SettingsFiles/AnalysisSpecDescriptor.txt for further details. If only interpolated data are to be used, 'Interp' will still be returned as FALSE if there are no gaps in the data set.

Descriptive Statistics

If there are more than 1 sets of results in the returned file, the descriptive statistics listed below will also be returned as a separate csv file. If both unfilled and interpolated data are used, then the statistics will be grouped by these (indicated by the 'Interp' column). If there are more than 1 unique values found in the 'trial' column (as extracted from the file names), descriptive statistics will be returned grouped by trial as well as for all data sets.

Data file compatibility

The required specifications to use text files exported with data from the Kistler Bioware software or the Tekscan Fscan research software (SAM) are included in the default DataFileSpec.csv. It would also be possible to use any other deliminated text file that also contain:

  1. Time and x/y locations of centre of force.
  2. The sample rate in the header of the file.
  3. For descriptive statistics to be returned grouped by trial type, these must be coded within the file name and the Regex expression in the analysis specifications file edited to extract these.

Running the source code

The main function is called as 'run_it()'. Passing the following values as TRUE will return additional behaviours;

Dependencis