grace_period {gfoRmulaICE}R Documentation

Strategy with Grace Period

Description

This function specifies an intervention in which treatment is initiated within the grace period of nperiod time units. During the grace period, the treatment variable follows its natural value or initiate intervention with a uniform distribution at each time point.

Usage

grace_period(type, nperiod, condition, data, id, time_name, outcome_name)

Arguments

type

a string specifying the type of grace period strategy. Possible values are "uniform" and "natural".

nperiod

a number indicating the length of grace period.

condition

a string specifying the logical expression, upon which is met, the treatment is initiated within nperiod time units.

data

a data frame containing the observed data.

id

a string specifying the ID variable name in data.

time_name

a string specifying the time variable name in data.

outcome_name

a string specifying the outcome variable name in data.

Value

a vector containing the intervened value of the same size as the number of rows in data.

Examples

data <- gfoRmulaICE::compData
grace_period <- grace_period(type = "uniform", nperiod = 2, condition = "L1 == 0", 
                            data = data, id = "id", time_name = "t0", outcome_name = "Y")

[Package gfoRmulaICE version 0.1.0 Index]