apply_censoring_hh2: Apply censoring scheme that is related to SES

Description Usage Arguments Details Value Examples

Description

Takes output from make_long() and applies censoring by predicting/fitting from a simple model

Usage

1
2
apply_censoring_hh2(data_in = NULL, simple_model = simplog,
  protected = c(1, 1.25, 1.5, 1.75, 2, 3))

Arguments

data_in

an object returned from calculate_ses()

protected

a vector corresponding to age / colnames of age_vec that are protected from censoring so that fpca.face() wont bonk

Details

Names are hard coded, so stick to script in the examples.

Value

prob.cens as a column added to data_in representing the probability of being censored at that time.

instudy.sim as a column added to data_in representing whether that particular observation is instudy (1) or not (0)

instudy as a column added to data_in builds upon instudy.sim in that once instudy.sim is 0 instudy is 0 for all remaining observation times

Examples

1
2
3
4
5
6
7
8
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)

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