Applies LOCF imputation to x within each id, assuming observations are
already ordered within each id.
Arguments
- x
Vector of values for LOCF imputation.
- id
Optional vector of cluster identifiers. If NULL, all observations
are treated as a single cluster.
Value
Vector of same length as x with LOCF applied within each id.