Skip to content
Goodness of Fit of Random Effect Distribution in Logistic Mixed Model
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
man
tests
vignettes
.Rbuildignore
.gitignore
CODE_OF_CONDUCT.md
DESCRIPTION
LICENSE.md
NAMESPACE
NEWS.md
README.Rmd
README.md
glmerGOF.Rproj

README.md

lifecycle

glmerGOF

The goal of glmerGOF is to provide a goodness of fit test of the presumed Gaussian distribution of the random effect in logistic mixed models fit with lme4::glmer(family = "binomial"). The method implemented is introduced in Tchetgen and Coull (2006):

Tchetgen, E. J., & Coull, B. A. (2006) A Diagnostic Test for the Mixing Distribution in a Generalised Linear Mixed Model. Biometrika, 93(4), 1003-1010. DOI: 10.1093/biomet/93.4.1003

Installation

glmerGOF is available through github:

remotes::install_github("BarkleyBG/glmerGOF")

Usage

An introductory tutorial is provided that describes how to use this package. The function that implements the test is glmerGOF::testGOF(), which takes as mandatory input:

  • a fitted lme4::glmer() model
  • a fitted survival::clogit() model
  • the original dataset
  • a list providing two variable names

Once the two models are fitted, then test statistics can be found:

TC_test <- testGOF(
  data = my_data,
  fitted_model_clogit = fit_clogit,
  fitted_model_glmm  = fit_glmm,
  var_names = list(DV = "y", grouping = "id"), 
  gradient_derivative_method = "simple"
)

The test results can be shown as:

TC_test$results
# $D
# [1] 1.230103
# 
# $p_value
# [1] 0.267387

Potential future developments

Please refer to the lifecycle badge for its current status. This package was created in early 2019 and may undergo future developments. Please email the maintainer if any of these changes are of interest, or if you would like to work on them:

  • Ability to manually align glmer and clogit coefficients
  • Parallelization backend
  • Updated model options

Contributor Code of Conduct

Please note that the ‘glmerGOF’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

You can’t perform that action at this time.