R/hd2amelia.R

Defines functions hd2amelia

Documented in hd2amelia

#' @title Convert hot.deck output to Amelia format.
#'
#' @description
#' Converts the output from hot.deck to the format used by Amelia for use with the Zelig package.
#'
#' @usage hd2amelia(object)
#'
#' @param object Output from a run of the \code{hot.deck} function.
#'
#' @return An object of class \dQuote{amelia} that can be used with Zelig.
#'
#' @export
hd2amelia <-
function(object){
    class(object) <- "amelia"
    names(object)[which(names(object) == "data")] <- "imputations"
    return(object)
}

Try the hot.deck package in your browser

Any scripts or data that you put into this service are public.

hot.deck documentation built on Aug. 17, 2021, 5:09 p.m.