limitedImpute: Limited last observation carried forward imputation

Description Usage Arguments Details Value

Description

limitedImpute will carry forward the last observation up to a specified threshold of days.

Usage

1

Arguments

var

Variable to be imputed forward in time.

date

Date variable corresponding to when var was measured.

limit

Number of days the forward imputation is limited to.

Details

This function is meant for indicators with missing values known to only occur for a limited amount of time. Examples include pregnancy (45-weeks) and tuberculosis treatment (8 months). Once the specified threshold has passed, the indicator reverts back to 0. If the values are non-missing, the value gets used regardless of whether it surpasses the threshold.

Value

The function returns a vector of length var, with the limited imputation carried out.


tranlm/lrecImpact documentation built on May 31, 2019, 7:45 p.m.