show_var {mixgb} | R Documentation |
Show multiply imputed values for a single variable
Description
Show m sets of imputed values for a specified variable.
Usage
show_var(imputation.list, var.name, original.data, true.values = NULL)
Arguments
imputation.list |
A list of |
var.name |
The name of a variable of interest. |
original.data |
The original data with missing data. |
true.values |
A vector of the true values (if known) of the missing values. In general, this is unknown ( |
Value
A data.table with m
columns, each of which represents a set of imputed values for the variable of interest. If true.values
is provided, an additional column will display the true values of the missing values.
Examples
# obtain m multiply datasets
params <- list(max_depth = 3, subsample = 1, nthread = 2)
mixgb.data <- mixgb(data = nhanes3, m = 3, xgb.params = params, nrounds = 20)
imputed.BMPHEAD <- show_var(
imputation.list = mixgb.data, var.name = "BMPHEAD",
original.data = nhanes3
)
imputed.BMPHEAD
[Package mixgb version 1.0.2 Index]