knitr::opts_chunk$set(echo = TRUE)
ClusterMultinom provides a suite of functions to make the process of fitting multinomial logistic regression models with clustered data, as well as extracting and visualizing meaningful results from those models, as painless as possible.
The package assumes your multinomial logistic regression model will be fit using VGAM::vglm(..., family = multinomial(...))
, and that you want to
calculate variance of beta coefficients using the bootstrap. It also allows for multiple imputation, using the mice
package and following the "boot MI" procedure recommended by Schomaker & Heumann.
The functions included mirror the following steps:
create_bootdata()
: Create B
datasets.M
times.summarize_multinom_list()
: Fit the same model to each bootstrapped dataset (or set of imputations), saving relevant information (especially coefficient
estimates).NOTE: FUNCTIONALITY CURRENTLY ENDS HERE
The functions are written and exported so that the user can access each step of the process independently if needed; however, wrappers are also provided to perform common tasks which fall completely within the context of the package.
Currently, purrr
and tibble
are Imported and all other package
dependencies are Suggested. Those suggested packages include, in order of
importance:
VGAM
: We chose VGAM::vglm()
for our multinomial logistic regression fits because it produces the most conservative warning messages of the options we tried, which are important when fitting a potentially unstable model to many bootstrapped datasets.mice
: mice
is a popular, flexible package for multiple imputation.gapminder
: Required only to run examples.testthat
: Required only for testing.rms
: Required only for testing,
but useful for fitting spline terms with rms::rcs()
.This is joint work with Rameela Chandrasekhar.
We are grateful to Cole Beck for his technical guidance and excellent debugging.
purrr
need not be installed to use this package.mlogit
or nnet::multinom()
model fits, in addition to VGAM::vglm()
.Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.