Skip to contents

Inputs for the deep imputation models (history = TRUE in imputeLongitudinal): without them each visit is completed from that visit alone, so an imputed value does not carry the subject's own level, which shrinks the estimated variation between subjects. For each visit and biomarker: the mean of the subject's other observed values of the biomarker, how many there are (log1p), and the value at the nearest other observed visit and its distance in time (log1p). The visit's own value is left out, so the model cannot simply copy it while training. A subject with no other observed value gets fill (by default the biomarker's overall mean) in place of the mean and the nearest value, a count of 0 and the largest distance.

Usage

history_features(aligned, id, time_variable, resp_mat, mask, fill = NULL)

Arguments

fill

Optional n x M matrix of stand-in values for a visit with no other observed value of a biomarker, e.g. each visit's prediction from its covariates. imputeLongitudinal() passes that prediction, so a subject never measured for a biomarker is not given the overall mean as if it were the subject's own level.

Value

A matrix with four columns per biomarker, one row per visit. Its "unseen" attribute holds the same features as if the subject had no other observed value of the biomarker (what a subject never measured for it gets); imputeLongitudinal() swaps them in at random while training (see history_dropout_inputs()).