Wolfgang Viechtbauer

Marginally significant (p = .07)

User Tools

Site Tools


rpkgsiuse

List of R Packages I Use

In my work, I make extensive use of the statistical software package/environment R. One of the great strengths of R is the large number of add-on packages that extend the functionality of R (i.e., the functionality of the base/standard packages that are installed by default) in various ways. Here, I keep track and list packages that I make use of on a (semi)regular basis. My work would be many magnitudes more difficult if these packages (and R itself!) did not exist.

Mixed-Effects Models

  • nlme and lme4: These are my go-to packages for fitting (generalized) (non-)linear mixed-effects models (e.g., for analyzing multilevel and longitudinal data).
  • GLMMadaptive and glmmML: Other useful packages for fitting generalized linear mixed-effects models.
  • glmmTMB: For mixed-effects models with zero-inflation, a dispersion model, and/or some alternative var-cov structures for the random effects.
  • MCMCglmm and brms: For fitting (generalized) linear mixed-effects models in a Bayesian framework.
  • mbest: For fitting (generalized) linear mixed-effects models using the method of moments.

Other Models/Analyses

  • survival: For time-to-event data / Cox proportional hazards regression models.
  • CAMAN and mclust: For fitting mixture models.
  • flexclust: Useful cluster algorithms.
  • aods3: For analyzing overdispersed counts and proportions.
  • censReg: For censored regression (Tobit) models.
  • betareg: For beta regression.
  • VGAM: For vector generalized linear and additive models.
  • gee, geepack, and glmtoolbox: For fitting models via generalized estimation equations (GEE).
  • mgcv: For generalized additive models (GAMs).

Analysis Tools

  • boot: As the name implies, for bootstrapping.
  • car: Package to accompany An R Companion to Applied Regression by Fox and Weisberg (2019). I regularly make use of some functions from this package such as linear.hypothesis and Anova.
  • lmtest and multcomp: Useful packages for getting post model fitting contrasts (i.e., testing general linear hypotheses).
  • lmerTest: For approximate Wald-type t-tests for lmer model objects.
  • emmeans: To obtain marginal means.
  • glmulti and MuMIn: Information theoretic methods for model selection, model averaging, and multimodel inference.
  • sandwich and clubSandwich: For (cluster) robust inferences using the Eicker-Huber-White method.
  • mice and miceadds: For multiple imputation.
  • MatchIt: For propensity score matching.

Numerical Methods

  • The stats package already provides a useful collection of optimizers (optimize, optim, nlminb, constrOptim, nlm functions). For root finding, I use the uniroot function.
  • minqa: Several derivative-free optimizers.
  • nloptr: Provides an R interface to NLopt, a free/open-source library for nonlinear optimization.
  • dfoptim: Includes another implementation of the Nelder-Mead algorithm (as in optim), the Hooke-Jeeves algorithm, and the Mesh Adaptive Direct Searches (MADS) algorithm.
  • ucminf and lbfgsb3c: Additional derivative-free, quasi-Newton type algorithms.
  • subplex: A subspace-searching simplex algorithm.
  • BB: For the Barzilai-Borwein gradient decent method.
  • optimParallel: Parallel version of the BFGS method.
  • cubature: For multivariate numerical integration (and integrate from stats for one-dimensional integration).
  • numDeriv: For numerical calculation of first and second order derivatives.
  • pracma: Also for numerical derivatives, integration, and some other numerical analysis functions.

Mathematics

Distributions

  • MASS: Package to support Modern Applied Statistics with S by Venables and Ripley (2002). Includes many useful functions, but mentioned here because of the mvrnorm function for generating data from a multivariate normal distribution and fitdistr for fitting univariate distributions.
  • mvtnorm: For the multivariate normal and t distribution.
  • BiasedUrn: For the noncentral hypergeometric distribution.
  • CompQuadForm: For the distribution function of quadratic forms.
  • SuppDists: For some other distributions.

Meta-Analysis

  • metafor: Obviously (I wrote it).
  • metadat: Lots of meta-analysis datasets.
  • meta: Another nice package for meta-analysis.
  • metaSEM: For approaching meta-analysis from a structural equation modeling (SEM) perspective.
  • Since meta-analysis is one of my primary research areas, I have played around with many packages mentioned under the Meta-Analysis Task View.

Psychometrics

  • psych and psychometric: Lots of functions for psychometric analyses (e.g., principal component analysis, factor analysis, reliability analysis).
  • GPArotation: Includes various rotation methods for factor analysis.
  • sem and lavaan: For confirmatory factor analysis (CFA) and structural equation modeling (SEM).
  • OpenMx: Another package for structural equation modeling; have used this mostly just for twin models.
  • ltm and eRm: For IRT analyses / Rasch modeling.

Bayesian Statistics

  • rjags: For interfacing with JAGS.
  • R2WinBUGS: For interfacing with OpenBUGS and WinBUGS.
  • coda: In combination with the previous two packages, for summarizing and plotting chains.
  • MCMCglmm and brms: For fitting (generalized) linear mixed-effects models in a Bayesian framework.

Genetics

  • genetics: Wide variety of functions for dealing with genetic data.
  • LDheatmap: For creating heat maps of the degree of linkage disequilibrium between SNPs.
  • poolr: For gene-based testing in GWAS.

High-Performance Computing

  • parallel: For the 'base R' way of doing parallel/multicore processing.
  • pbapply: To show progress bars when using parallel processing.
  • future and future.apply: For the 'future' way of doing parallel/multicore processing.

Graphing

  • graphics: I am an old fart when it comes to graphics, sticking mostly to 'base graphics' (I don't actually have any strong opinions on 'base graphics' versus 'ggplot2'; I got into R before ggplot2 or even ggplot was around and just learned how to get all my graphing done with the tools available at the time – and that still works for me).
  • lattice and latticeExtra: But occasionally I use trellis-type graphics (especially in combination with multilevel or longitudinal data).
  • plotly: And for creating interactive graphics, plotly is really nice.
  • igraph: For drawing network graphs/analyses.
  • viridis and viridisLite: Some very nice color maps.
  • RColorBrewer: And more color schemes.
  • MASS: The kde2d function for 2d kernel density estimation and plotting.
  • akima and interp: For interpolating gridded data so that it can be plotted with functions that require a matrix as input.
  • hexbin: Another approach for creating scatterplots that indicate the density of particular areas.
  • beanplot, beeswarm, and vioplot: For bean, bee swarm, and violin plots (as alternatives to standard boxplots).
  • scatterplot3d and rgl: When I want to show off with 3-dimensional plots.
  • extrafont: For making use of additional fonts in graphs.
  • Cairo: For the Cairo graphics device.

Package Development

  • devtools: Various useful functions for package development.
  • remotes: For installing (usually development versions of) packages from GitHub and other repos.
  • testthat: For software/unit testing.
  • covr: For tracking/reporting code coverage of the tests.
  • Formula: To make use of extended formulas in model fitting functions.
  • mathjaxr: To include nicely rendered equations (via MathJax) in the HTML help files of an R package.

Dynamic Documents

  • pander: For pandoc markdown.
  • knitr and rmarkdown: Tools for generating dynamic documents (besides utils::Sweave)
  • table1 and tableone: for creating tables with descriptive statistics (typically for multiple groups).

Utilities

rpkgsiuse.txt · Last modified: 2023/11/20 10:29 by Wolfgang Viechtbauer