Learn R Programming

dlookr (version 0.3.9)

summary.imputation: Summarizing imputation information

Description

print and summary method for "imputation" class.

Usage

# S3 method for imputation
summary(object, ...)

Arguments

object

an object of class "imputation", usually, a result of a call to imputate_na() or imputate_outlier().

...

further arguments passed to or from other methods.

Details

summary.imputation tries to be smart about formatting two kinds of imputation.

See Also

imputate_na, imputate_outlier, summary.imputation.

Examples

Run this code
# NOT RUN {
# Generate data for the example
carseats <- ISLR::Carseats
carseats[sample(seq(NROW(carseats)), 20), "Income"] <- NA
carseats[sample(seq(NROW(carseats)), 5), "Urban"] <- NA

# Imputate missing values -----------------------------
# If the variable of interest is a numarical variable
income <- imputate_na(carseats, Income, US, method = "rpart")
income
summary(income)
plot(income)

# If the variable of interest is a categorical variable
urban <- imputate_na(carseats, Urban, US, method = "mice")
urban
summary(urban)
plot(urban)

# Imputate outliers ----------------------------------
# If the variable of interest is a numarical variable
price <- imputate_outlier(carseats, Price, method = "capping")
price
summary(price)
plot(price)
# }

Run the code above in your browser using DataLab