Title: Non-Parametric Measures of Actigraphy Data
Version: 0.9.1
Description: Computes interdaily stability (IS), intradaily variability (IV) & the relative amplitude (RA) from actigraphy data as described in Blume et al. (2016) <doi:10.1016/j.mex.2016.05.006> and van Someren et al. (1999) <doi:10.3109/07420529908998724>. Additionally, it also computes L5 (i.e. the 5 hours with lowest average actigraphy amplitude) and M10 (the 10 hours with highest average amplitude) as well as the respective start times. The flex versions will also compute the L-value for a user-defined number of minutes. IS describes the strength of coupling of a rhythm to supposedly stable zeitgebers. It varies between 0 (Gaussian Noise) and 1 for perfect IS. IV describes the fragmentation of a rhythm, i.e. the frequency and extent of transitions between rest and activity. It is near 0 for a perfect sine wave, about 2 for Gaussian noise and may be even higher when a definite ultradian period of about 2 hrs is present. RA is the relative amplitude of a rhythm. Note that to obtain reliable results, actigraphy data should cover a reasonable number of days.
License: GPL-3
Imports: ggplot2, grid, stringr, zoo, tools
Language: en-GB
LazyData: true
RoxygenNote: 7.3.2
Encoding: UTF-8
Depends: R (≥ 3.5)
Suggests: knitr, rmarkdown, roxygen2
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-12-16 09:35:53 UTC; chris
Author: Christine Blume ORCID iD [aut, cre]
Maintainer: Christine Blume <christine.blume@unibas.ch>
Repository: CRAN
Date/Publication: 2025-12-16 09:50:02 UTC

nparACT: Non-parametric analysis of actigraphy data

Description

Tools for computing classic non-parametric actigraphy measures, including interdaily stability (IS), intradaily variability (IV), relative amplitude (RA), as well as the L5 and M10 values and their respective start times.

Author(s)

Maintainer: Christine Blume christine.blume@unibas.ch (ORCID)


Compute classic non-parametric actigraphy measures

Description

Computes the classic non-parametric actigraphy measures interdaily stability (IS), intradaily variability (IV), relative amplitude (RA), as well as the L5 and M10 values and their respective start times, for a single actigraphy file.

Usage

nparACT_base(name, SR, cutoff = 1, plot = T, fulldays = T)

Arguments

name

Character string giving the name of the object in the workspace that contains the actigraphy data.

SR

Numeric. Sampling rate in Hertz (samples per second).

cutoff

Numeric. Activity threshold used to classify movement. Defaults to 1.

plot

Logical. If TRUE, diagnostic plots of the hourly and minute-wise activity profiles are generated. Defaults to TRUE.

fulldays

Logical. If TRUE, data are truncated to include only complete 24-hour periods. Defaults to TRUE.

Details

The function expects the actigraphy data to be available in the workspace under the name provided via name. Data are internally pre-processed, optionally restricted to complete 24-hour periods, and analysed using standard non-parametric actigraphy algorithms.

The input data may contain either two columns (time, activity) or three columns (date, time, activity). Time variables are internally converted to POSIXct. Missing values in the activity signal are not permitted.

The computation of IS and IV is based on hourly averaged activity data. Relative amplitude (RA) is derived from the difference between the most active 10-hour period (M10) and the least active 5-hour period (L5).

Value

A data frame with one row and the following columns:

IS

Interdaily stability

IV

Intradaily variability

RA

Relative amplitude

L5

Mean activity during the least active 5-hour period

L5_starttime

Start time of the L5 period

M10

Mean activity during the most active 10-hour period

M10_starttime

Start time of the M10 period


Compute classic non-parametric actigraphy measures for multiple files

Description

Computes the classic non-parametric actigraphy measures: interdaily stability (IS), intradaily variability (IV), relative amplitude (RA), as well as the L5 and M10 values and their respective start times for all actigraphy files in a specified folder.

Usage

nparACT_base_loop(path, SR, cutoff = 1, plot = TRUE, fulldays = TRUE)

Arguments

path

Character string. Path to the folder containing actigraphy files.

SR

Numeric. Sampling rate in Hertz (samples per second).

cutoff

Numeric. Activity threshold used to classify movement. Defaults to 1.

plot

Logical. If TRUE, generates diagnostic plots of the hourly grand-average activity profiles. Defaults to TRUE.

fulldays

Logical. If TRUE, data are truncated to include only complete 24-hour periods. Defaults to TRUE.

Details

Each file is expected to contain either two columns (time, activity) or three columns (date, time, activity). Time variables are internally converted to POSIXct. Missing values in the activity signal are not permitted.

Each file should contain either two columns (time, activity) or three columns (date, time, activity). Time variables are converted to POSIXct. Missing activity values are not allowed. The function filters activity, computes minute/hourly averages, calculates IS/IV/RA, and optionally plots grand-average activity profiles.

Value

A data frame with one row per file and the following columns:

IS

Interdaily stability

IV

Intradaily variability

RA

Relative amplitude

L5

Mean activity during the least active 5-hour period

L5_starttime

Start time of the L5 period

M10

Mean activity during the most active 10-hour period

M10_starttime

Start time of the M10 period


Compute non-parametric actigraphy measures with a flexible low-activity window

Description

Computes the classic non-parametric actigraphy measures interdaily stability (IS), intradaily variability (IV), and relative amplitude (RA), as well as the L5 and M10 values and their respective start times. In addition, the function computes a flexible low-activity period (Lflex) of user-defined duration and its start time for a single actigraphy file.

Usage

nparACT_flex(name, SR, cutoff = 1, minutes, plot = T, fulldays = T)

Arguments

name

Character string giving the name of the object in the workspace that contains the actigraphy data.

SR

Numeric. Sampling rate in Hertz (samples per second).

cutoff

Numeric. Activity threshold used to classify movement. Defaults to 1.

minutes

Numeric. Length of the flexible low-activity window (Lflex) in minutes.

plot

Logical. If TRUE, diagnostic plots of the hourly and minute-wise activity profiles are generated. Defaults to TRUE.

fulldays

Logical. If TRUE, data are truncated to include only complete 24-hour periods. Defaults to TRUE.

Details

The function expects the actigraphy data to be available in the workspace under the name provided via name. Data are internally pre-processed, optionally restricted to complete 24-hour periods, and analysed using standard non-parametric actigraphy algorithms.

The input data may contain either two columns (time, activity) or three columns (date, time, activity). Time variables are internally converted to POSIXct. Missing values in the activity signal are not permitted.

Interdaily stability (IS) and intradaily variability (IV) are computed from hourly averaged activity data. Relative amplitude (RA) is derived from the difference between the most active 10-hour period (M10) and the least active 5-hour period (L5). The flexible low-activity measure (Lflex) represents the least active contiguous period of the duration specified by minutes.

Value

A data frame with one row and the following columns:

IS

Interdaily stability

IV

Intradaily variability

RA

Relative amplitude

L5

Mean activity during the least active 5-hour period

L5_starttime

Start time of the L5 period

M10

Mean activity during the most active 10-hour period

M10_starttime

Start time of the M10 period

Lflex

Mean activity during the least active flexible period

Lflex_starttime

Start time of the Lflex period


Compute non-parametric actigraphy measures with a flexible low-activity window for multiple files

Description

Computes the classic non-parametric actigraphy measures interdaily stability (IS), intradaily variability (IV), and relative amplitude (RA), as well as the L5 and M10 values and their respective start times. In addition, the function computes a flexible low-activity period (Lflex) of user-defined duration and its start time, looping over all actigraphy files contained in a specified directory.

Usage

nparACT_flex_loop(path, SR, cutoff = 1, minutes, plot = T, fulldays = T)

Arguments

path

Character string specifying the path to a directory containing the actigraphy files to be analysed.

SR

Numeric. Sampling rate in Hertz (samples per second).

cutoff

Numeric. Activity threshold used to classify movement. Defaults to 1.

minutes

Numeric. Length of the flexible low-activity window (Lflex) in minutes.

plot

Logical. If TRUE, group-level diagnostic plots of hourly activity profiles are generated. Defaults to TRUE.

fulldays

Logical. If TRUE, data are truncated to include only complete 24-hour periods. Defaults to TRUE.

Details

Each file in the directory is processed independently using the same parameters. Results are returned as one row per file.

Files in path are expected to be plain text or CSV files with either two columns (time, activity) or three columns (date, time, activity). Time variables are internally converted to POSIXct. Missing values in the activity signal are not permitted.

Interdaily stability (IS) and intradaily variability (IV) are computed from hourly averaged activity data. Relative amplitude (RA) is derived from the difference between the most active 10-hour period (M10) and the least active 5-hour period (L5). The flexible low-activity measure (Lflex) represents the least active contiguous period of the duration specified by minutes.

If plot = TRUE, an aggregated (grand average) hourly activity profile across all files is generated.

Value

A data frame with one row per processed file and the following columns:

IS

Interdaily stability

IV

Intradaily variability

RA

Relative amplitude

L5

Mean activity during the least active 5-hour period

L5_starttime

Start time of the L5 period

M10

Mean activity during the most active 10-hour period

M10_starttime

Start time of the M10 period

Lflex

Mean activity during the least active flexible period

Lflex_starttime

Start time of the Lflex period


Actigraphy results from a participant.

Description

A dataset containing actimetry results for one participant. Data points have been collected every 15 sec and span approx. 3.5 days. The variables are as follows:

Usage

sleepstudy

Format

A txt file with 20000 rows and 2 variables:

Type

Time stamp

Description

Gives the activity measured with actigrapy (arbitrary number)