Artikel-Schlagworte: „R“

At first, if you are not familiar with R, you need to install R from CRAN and (under Win32) Tinn-R. Tinn-R enables to control R via script. If you use Linux, just install R via your distribution of choice and then there is an add-on for Emacs to control R (ESS). The next is to start R via Tinn-R or Emacs. Don’t forget to choose you ‚hotkeys‚ in Tinn-R (or any other editor of your choice to control R).

For multiple imputation, I choose the R-package ‚mice‚ from van Buuren et al. You have to install it manually. There are also other packages that deal with it, see:"imputation")

If you are not familiar with the R-style to formulate linear models, start with


or read the usual intros and manuals that are linked via CRAN (or the contributed documentations) – otherwise search on the internet with your search machine of choice with the add-on ‚cran‘ like ‚mulitple imputation cran‘ or ‚missing data cran‘, etc.

The folllowing are excerpts from the man-pages of ‚mice‘-package commandos.

?read.table       # import of data - see tutorials and intros to R
                  # of 'how to import data'
library(help=mice)# what is inside package 'mice'?
library(mice)     # load library for MI
data(nhanes)      # use data from 'mice'-package
nhanes            # show data
?mice             # produce Multivariate Imputation by Chained Equations
imp <- mice(nhanes)
?lm.mids          # Performs repeated linear regression
                  # on multiply imputed data set
lm.mids           # R-source code of 'lm.mids'
fit <- lm.mids(bmi~hyp+chl,data=imp)
?pool             #
pool(fit)         # pool results
summary(pool(fit))# better output
pool              # R-source code of 'pool'

That’s all. Multiple imputation (ordinary ANOVA) is quite easy to peform in R.

Do you also think that (La)TeX is wonderful, but most styles are a little bit boring and they do not look very exciting? Maybe this is not really important for scientific publications, but as long as people from practice or non-scientific fields of interest are part of the intended audience, it makes really sense to think seriously about the layout. In the past, I used koma-script which works fine and produces very good results. It is fitted for European needs and its special local requirements. Some time ago, I needed a better style for title pages and chapters. In ‚memoir class‘ from Peter Wilson I found the right document class for LaTeX. It provides a lot of styles that can be changed quite easily and without much effort to fit personal requirements. It allows for nice looking epigraphs and all that stuff of page layout which is necessary (many different font sizes, etc.). For the bad news – memoir is incompatible with ‚fancyhdr‘ – and for the good news – it provides equivalent opportunities. The user guide of memoir is very comprehensive. However, the short guide written by Lars Madsen is a good starting point to produce page styles together with memoir. Further styles can be found on the pages of Vincent Zoonekynd. There are chapter styles and title page styles available together with TeX-code and how the output looks like. He even produced section styles. At this point it must be mentioned that Zoonekynd also offers a huge free R-book on his website. Although it is not finished yet, it provides many examples of how to use R for statistical analyses, graphics, and demonstrations. If you use Lyx instead of plain TeX, the Lyx-Wiki contains a special page dedicated to the memoir class.