<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/multiple-imputation-for-continuous-and-categorical-data/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://francoishusson.wordpress.com/2017/08/05/multiple-imputation-for-continuous-and-categorical-data-2/"> François Husson</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>“<em>The idea of imputation is both seductive and dangerous</em>” (R.J.A Little &amp; D.B. Rubin).</p>
<p>Indeed, a predicted value is considered as an observed one and the uncertainty of prediction is ignored, conducting to bad inferences with missing values. That is why <strong>Multiple Imputation</strong> is recommended.</p>
<p>The <strong>missMDA package </strong>quickly generates several imputed datasets with <strong>quantitative</strong> variables and/or <strong>categorical</strong> variables. It is based on dimensionality reduction methods such as PCA for continuous variables or multiple correspondence analysis for categorical variables. Compared to the packages <strong>Amelia</strong> and <strong>mice</strong>, it better handles cases where the number of variables is larger than the number of units, and cases where regularization is needed (i.e. when the imputation model is prone to overfitting issues). For categorical variables, it is particularly interesting with many variables and many levels, but also with rare levels.</p>
<p>With 3 lines of code, we generate 1000 imputed datasets for the quantitative <em>orange data </em>available in <strong>missMDA</strong>:</p>
<blockquote>
<pre>library(missMDA)
data(orange)
nbdim &lt;- estim_ncpPCA(orange) # estimate the number of dimensions to impute
res.comp &lt;- MIPCA(orange, ncp = nbdim, nboot = 1000)</pre>
</blockquote>
<p>In the same way, <strong>MIMCA</strong> can be used for categorical data:</p>
<blockquote>
<pre>library(missMDA)
data(vnf)
nb &lt;- estim_ncpMCA(vnf,ncp.max=5) ## Time-consuming, nb = 4
res &lt;- MIMCA(vnf, ncp=4,nboot=10)</pre>
</blockquote>
<p>You can find more information in this <a rel="nofollow" href="https://www.jstatsoft.org/article/view/v070i01" target="_blank">JSS paper</a>, on this<a rel="nofollow" href="http://math.agrocampus-ouest.fr/infoglueDeliverLive/developpement/missMDA" target="_blank"> website</a>, on this tutorial given at <a rel="nofollow" href="http://juliejosse.com/wp-content/uploads/2016/06/user2016.pdf" target="_blank">useR!2016 at stanford</a>.</p>
<p>You can also watch this <a rel="nofollow" href="https://www.youtube.com/watch?v=OOM8_FH6_8o&list=PLnZgp6epRBbQzxFnQrcxg09kRt-PA66T_" target="_blank">playlist on Youtube</a> to practice with R.</p>
<p>You can also contact us:<br>
julie.josse@polytechnique.edu       @JulieJosseStat<br>
husson@agrocampus-ouest.fr</p>
<p> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/francoishusson.wordpress.com/489/" target="_blank"><img border="0" alt="" src="http://feeds.wordpress.com/1.0/comments/francoishusson.wordpress.com/489/"></a> <img border="0" alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" data-recalc-dims="1"></p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://francoishusson.wordpress.com/2017/08/05/multiple-imputation-for-continuous-and-categorical-data-2/"> François Husson</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/0FaoDNmjUFo" height="1"></a></div>