Skip to contents

The function mad produces PGS values in a tibble object.

Usage

pgs(data, dur_length = 20, end_length = 30)

Arguments

data

DataFrame object with column names "id", "time", and "gl". Should only be data for 1 subject. In case multiple subject ids are detected, a warning is produced and only 1st subject is used.

dur_length

Numeric value specifying the minimum duration in minutes to be considered an episode. Note dur_length should be a multiple of the data recording interval otherwise the function will round up to the nearest multiple. Default is 20 minutes to match the original PGS definition.

end_length

Numeric value specifying the minimum duration in minutes of improved glycemia for an episode to end. Default is 30 minutes to match original PGS definition.

Value

A tibble object with two columns: subject id and corresponding PGS value.

Details

A tibble object with 1 row for each subject, a column for subject id and a column for GVP values is returned. NA glucose values are omitted from the calculation. Note that the duration thresholds for episodes are NOT the same as the episode_calculation defaults. The defaults chosen for PGS are those that match the original PGS paper definition, while the episode_calculation defaults match the consensus.

References

Hirsch et al. (2017): A Simple Composite Metric for the Assessment of Glycemic Status from Continuous Glucose Monitoring Data: Implications for Clinical Practice and the Artificial Pancreas Diabetes Technol Ther 19(S3) .S38-S48, doi:10.1089/dia.2017.0080 .

See also

episode_calculation()

Author

Elizabeth Chun

Examples


data(example_data_1_subject)
pgs(example_data_1_subject)
#> # A tibble: 1 × 2
#>   id          PGS
#>   <fct>     <dbl>
#> 1 Subject 1  6.06