calculate_stipw_generic: Calculate STIPW based on propensity for being study

Description Usage Arguments Value Examples

Description

Whereas in calculate_stipw() the names are hardcoded for the Berkeley Study simulation; We aim here to generalize the stipw for the HIV application. Thus the name calculate_stipw_generic().

Usage

1
calculate_stipw_generic(data_in = NULL, na.action = "omit")

Arguments

data_in

a data.table (see the data.table package, Tutorial, and FAQs) that is in long format of at least the id, time, and outcome and some covariates for the probability weights.

na.action

"keep" means the dataset returned will be same number of rows as data_in and "omit" discards all data past censoring observation

Value

a data.table similar to data_in with stipw in columns; and potentially fewer rows or NA-filled rows for induced censoring.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## revisit this example/flow for HIV application...
d<-prep_data()
head(d)
over_samp_mat<-sample_data(d,1000)
with_ses <- calculate_ses(over_samp_mat)
long <-make_long(with_ses)
head(long)
censored <- apply_censoring(long)
head(censored,18)
observed_with_stipw <- calculate_stipw(censored,"keep")

swihart/wfpca documentation built on May 30, 2019, 10:38 p.m.