Performs last observation carried forward (LOCF) imputation on a column of data.
1 2 3
A vector in
A vector of times at which to impute values, in
A vector of obseved values in
A vector of observation times corresponding to
How to handle times prior to the first observation. See details.
A value to use when no other value is appropriate.
These functions operate on data sets in
blk.locf fills in
the missing values in
x using the observed values. Time is
implicit; the time-ordering of
x (within blocks of
id) is required.
blk.locf2 observations and corresponding times are
specified separately from the times at which imputation is
desired. This function is essentially equivalent to
direction = "forward" and
tol = Inf.
na.action is used to control the result
when there is no previous non-missing value available. With
na.action = "fill" the valued specified with
fill is used. With
na.action = "carry.back",
the earliest available non-missing future value is used.
If there is no non-missing observed values for a level of
id, the result is
NA for that
id at all time points.
Less frequently used is next observation carried back (NOCB). Here, future observations are used to fill in the missing values at earlier times.
A vector in
block-format with respect to
Ben Rich <firstname.lastname@example.org>
1 2 3 4 5 6 7 8 9 10
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.