Impute.purse {COINr} | R Documentation |
Impute data sets in a purse
Description
This function imputes the target data set dset
in each coin using the imputation function f_i
. This is performed
in the same way as the coin method Impute.coin()
, but with one "special case" for panel data. If f_i = "impute_panel
,
the data sets inside the purse are imputed using the impute_panel()
function. In this case, coins are not imputed individually, but treated as a single data set. In this
case, optionally set the imputation method as f_i_para = list(imp_type = .)
and f_i_para = list(max_time = .)
where .
should be substituted with the maximum
number of time points to search backwards for a non-NA
value. See impute_panel()
for more details.
No further arguments need to be passed to impute_panel()
. See vignette("imputation")
for more
details. See also Impute.coin()
documentation.
Usage
## S3 method for class 'purse'
Impute(
x,
dset,
f_i = NULL,
f_i_para = NULL,
impute_by = "column",
group_level = NULL,
use_group = NULL,
normalise_first = NULL,
write_to = NULL,
warn_on_NAs = TRUE,
...
)
Arguments
x |
A purse object |
dset |
The name of the data set to apply the function to, which should be accessible in |
f_i |
An imputation function. For the "purse" class, if |
f_i_para |
Further arguments to pass to |
impute_by |
Specifies how to impute: if |
group_level |
A level of the framework to use for grouping indicators. This is only
relevant if |
use_group |
Optional grouping variable name to pass to imputation function if this supports group imputation. |
normalise_first |
Logical: if |
write_to |
Optional character string for naming the resulting data set in each coin. Data will be written to
|
warn_on_NAs |
Logical: if |
... |
arguments passed to or from other methods. |
Value
An updated purse with imputed data sets added to each coin.
Examples
# see vignette("imputation")