This function performs the data expansion for a given dataset
expand(
sw_data,
outcomeCov_var,
where_var,
use_censor,
maxperiod,
minperiod,
keeplist
)
datatable to expand
A list of individual baseline variables used in final model
Variables used in where conditions used in subsetting the data used in final analysis (where_case), the variables not included in the final model
Use censoring for per-protocol analysis - censor person-times once a person-trial stops taking the initial treatment value
Maximum period
Minimum period
A list contains names of variables used in final model