Learn R Programming

LTASR (version 0.1.4)

exp_strata: Create exp_strata object

Description

exp_strata() creates an exp_strata that defines which variable to consider, any lag to be applied, and cutpoints for the strata.

Usage

exp_strata(var = character(), cutpt = numeric(), lag = 0)

Value

an object of class exp_strata to be used in the get_table_history().

Arguments

var

character naming the variable within the history data.frame to consider.

cutpt

numeric vector defining the cutpoints to use to stratify the calculated cumulative exposure for variable var. Should include min and max values (typically -Inf and Inf).

lag

numeric defining the lag, in years, to be applied to exposure variables. Default is 0 yrs (i.e. unlagged). Must be a whole number.

Examples

Run this code
library(LTASR)
exp1 <- exp_strata(var = 'employed',
                   cutpt = c(-Inf, 365, Inf),
                   lag = 10)

Run the code above in your browser using DataLab