apply_locf_nocb: Impute Missing Values Using LOCF and NOCB
Description
Imputes missing values in a matrix by applying Last Observation Carried Forward (LOCF) followed by
Next Observation Carried Backward (NOCB) for each subject.
Usage
apply_locf_nocb(X, subject_id)
Value
A matrix with missing values imputed using LOCF and NOCB.
Arguments
X
A matrix where rows represent observations and columns represent variables.
subject_id
A vector of subject IDs corresponding to the rows of X.