tsTrends: Calculate linear trends for a set of time series variables...

Description Usage Arguments Value

Description

Calculate linear trends for a set of time series variables For each combination of idvar and measure regress measure values against time period. The result will be the best linear approximation of the measure slope as a function of time

Usage

1
tsTrends(df, idvar, pfx, sfx, reverse = FALSE)

Arguments

df

(data frame) data frame containing the time series variables of interest

idvar

(character) name of the variable that uniquely identifies observations in the data

pfx

(character) vector of prefix patterns for each time series measure

sfx

(character) pattern to match time period suffix values

reverse

(logical) reverse the order of period values when calculating linear trends

Value

a data frame containing the idvar and one column for each time series measure containing the linear trends for that idvar and measure combination


etlundquist/eRic documentation built on May 16, 2019, 9:07 a.m.