getSeasonalityScore: Get the seasonality score for a given monthly time series

Description Usage Arguments Details Value

View source: R/getSeasonalityScore.r

Description

The seasonality score of a monthly time series is computed as its departure from a uniform distribution.

Usage

1
tsData.ss <- getSeasonalityScore(tsData)

Arguments

tsData

A time series object.

Details

The degree of seasonality of a monthly time series is based on its departure from a uniform distribution. If the number of cases for a given concept is uniformly distributed across all time periods (in this case, all months), then its monthly prevalence (as well as proportion) would be approximately constant. These time series would be considered "absolutely non-seasonal" and their "seasonality score" would be zero. Similarly, if all the cases occur at a single point in time (that is, in a single month), such a time series would be considered "absolutely seasonal" and its seasonality score would be 1. All other time series would have a seasonality score between 0 and 1. Currently, only monthly time series are supported. NB: To be able to compute a seasonality score, a time series must have a minimum of three complete years of data.

Value

A numeric value between 0 and 1 (inclusive) representing the seasonality of a concept.


OHDSI/Castor documentation built on March 20, 2021, 6:09 p.m.