R/datlist2Amelia.R

Defines functions datlist2Amelia

Documented in datlist2Amelia

## File Name: datlist2Amelia.R
## File Version: 0.07

datlist2Amelia <- function(datlist)
{
    if (inherits(datlist,"mids")){
        datlist <- mids2datlist(midsobj=datlist)
    }
    # define results object
    m <- length(datlist)
    names(datlist) <- paste0("imp",1:m)
    res <- list(imputations=datlist)
    res$m <- m
    res$orig.vars <- colnames(datlist[[1]])
    # define missing indicator matrix
    res$missMatrix <- ! extract_response_matrix(datlist=datlist)
    #- output
    class(res) <- "amelia"
    return(res)
}

Try the miceadds package in your browser

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

miceadds documentation built on May 29, 2024, 11:05 a.m.