\documentclass[a4paper]{article}


\usepackage{graphicx}
\usepackage{Rd, parskip, amsmath, enumerate}
\usepackage[round]{natbib}
\usepackage{hyperref}
\usepackage{color}


\title{Multiple Imputation in the Presence of High-dimensional data}
\author{Yi Deng\\
Yize Zhao\\
Qi Long}

\begin{document}
\SweaveOpts{concordance=TRUE}


\maketitle
\section{Introduction}
Missing data are often encountered in medical and epidemiological research and present challenges for data analysis. There are numerous reasons for missing data; it could be due to the declination of a subject or to errors made during data collection. It is well known that inadequate handling of missing data may lead to biased estimation and inference.
A number of statistical methods have been developed for handling missing data. Largely due to it ease of use, multiple imputation (MI) has been arguably the most popular method for handling missing data in practice.  The basic idea underlying MI is to replace each missing data point with  a set of values drawn from its predictive distribution given observed data and generate multiply imputed datasets to account for uncertainty of imputation. Each imputed data set is then analyzed separately using standard complete-data analysis methods and the results are combined across all imputed data sets using Rubin's rule. 

While methods and applications of MI are well implemented in some existing softwares and R packages, no package has been focused on MI in the presence of high-dimensional data.  In real world, we might encounter data with dimensions ranging from a few dozen to several thousand. For instance, DNA microarrays measure the expression levels of large numbers of genes simultaneously, which lead to the fact that the number of variables p is much larger than the number of observations. Existing methods and their software packages of MI cannot handle the 'p larger than n' issue and were shown to have poor performance for other high-dimensional data in numerical studies. 

Zhao and Long (2013) developed three approaches for multiple imputations in the presence of high-dimensional data of univariate missing patterns. In their paper, regularized regressions are applied in order to fit a penalized imputation model. We implement and include their algorithms in this package. In addition, we extend their methods to be applicable for general missing data patterns based on the idea of multiple imputation by chained equations (MICE). 

In this document, we will give a short tutorial on using the functions in the package to conduct imputations for incomplete data sets with univariate or general missing patterns. In Section \ref{Uni}, we illustrate three datasets that have univariate missing patterns with one single partially observed variable following gaussian, binary, and poisson distributions respectively. We give examples of using our functions to conduct multiple imputation for different types of data set. In Section \ref{Gene}, synthetic data set is presented and is used to illustrate multiple imputation for general missing data patterns in the presence of high-dimensional data. All functions offer three regularized regression to choose: lasso, elastic net, adaptive lasso. Also, bayesian lasso is implemented in the case of univariate missing patterns.

\section{Univariate missing pattern} \label{Uni}
The section presents three examples incorporating three types of data sets that have univariate missing patterns. After installing the \R{} package \pkg{MIHD} as well as its dependency packages, load the pacage.
<<echo=TRUE,eval=TRUE>>=
library('MIHD')
@
This document uses the features of \pkg{MIHD} 3.0, which contains three data sets for univariate missing patterns. Missing values are represented as \code{NA}. We first load these three data sets so that they can be used for imputations.
<<echo=TRUE,eval=TRUE>>=
data(datagaussian)
data(databinary)
data(datapoisson)
@
Take the data frame \code{datagaussian} for instance. Missing values appear only in the first column, which corresponds to a partially observed variable following gaussian distribution. \code{datagaussian} has 100 subjects and 1001 variables, thus can be viewed as a high-dimensional data.
<<echo=TRUE,eval=TRUE>>=
sum(is.na(datagaussian))
sum(is.na(datagaussian))/dim(datagaussian)[1]
@
Among 100 subjects, 35 (35\%) of them are missing their first column values. With the help of \code{MIdurr} and \code{MIiurr} functions in this packages, we could impute these missing values.

Creating imputations can be done with a call to \code{MIdurr()} as follows"
<<echo=TRUE,eval=TRUE>>=
imp=MIdurr(data=datagaussian,method="lasso",family="gaussian",m=5)
@
where the multiply imputed data set is stored in the object \code{imp}. Inspect what the result looks like
<<echo=TRUE,eval=TRUE>>=
imp$n.missing
imp$col.missing
head(imp$impute)
@
In the output, {\tt n.missing} means the number of missing values in the data.{\tt col.missing} gives the value of which column contains the missing values. The result shows that the first column has missing values. Imputations are generated according to the lasso regression for gaussian outcome. {\tt impute} gives us imputations matrix with column number equals to m. Note, each column is an imputation.

We can also conduct multiple imputations for other types of data using different methods of regularized regressions.
<<echo=TRUE,eval=FALSE>>=
MIdurr(data=datagaussian,method="adaptive lasso",family="gaussian")
MIdurr(data=datagaussian,method="blasso",family="gaussian")
MIdurr(data=databinary,method="lasso",family="binary")
MIdurr(data=databinary,method="adaptive lasso",family="binary")
MIdurr(data=databinary,method="blasso",family="binary")
@
Another approach is IURR:
<<echo=TRUE,eval=FALSE>>=
MIiurr(data=datagaussian,method="lasso",family="gaussian")
MIiurr(data=databinary,method="adaptive lasso",family="binary")
@

\section{General missing pattern} \label{Gene}

In this section, we give a complete example of analyze an incomplete high-dimensional data with general missing pattern following three steps: multiple imputations using DURR or IURR; converting the imputation results into \code{mids} object; analysis of converted data.
To illustrate these three steps, we first load our synthetic data set \code{GMdata}
<<echo=TRUE,eval=TRUE>>=
data(GMdata)
@
\subsection{Creating imputations}
Similar to what we did in the last section, we can create imputations with a call to \code{GMdurr} if we apply DURR method (IURR can be done very similarly).
<<echo=TRUE,eval=TRUE>>=
GM.imp=GMdurr(data=GMdata)
@
The default number of multiple imputations is 5. We burn 20 iterations by default for the consideration of convergence.
\subsection{Converting into \code{mids} object}
Sometimes, obtaining the imputed data sets is not enough. We also want to do the analysis using these multiple data sets. \code{as.mice} function is built to convert an multiply imputed dataset obtained from DURR and IURR functions into a mids object.
<<echo=TRUE,eval=TRUE>>=
imp=as.mice(data=GMdata,imp=GM.imp)
head(imp$nmis)
@
The imputations for \code{z1} are stored as
<<echo=TRUE,eval=TRUE>>=
imp$imp$z1
@
Each row corresponds to a missing entry in z1. The columns contain the multiple imputations. The completed data set combines the observed and imputed values. The (first) completed data set can be obtained as
<<echo=TRUE,eval=FALSE>>=
complete(imp)
@

\subsection{Analysis of imputed data}
Supoose that we are interted in a linear regression of z1 on z2 and z4 in the complete-data analysis. For this purpose, we can use the function \code{with()}.
<<echo=TRUE,eval=TRUE>>=
fit=with(imp,lm(z1~z2+z4))
@
The \code{fit} object contains the results of five complete-data analyses and can be pooled as follows:
<<echo=TRUE,eval=TRUE>>=
print(pool(fit))
@
More detailed output can be obtained with \code{summary()}, i.e.,
<<echo=TRUE,eval=TRUE>>=
round(summary(pool(fit)),3)
@
























\section{References}

Zhao, Y., and Long, Q. (2013). Multiple imputation in the presence of high-dimensional data. Statistical Methods in Medical Research, in press.

\end{document}
