lifecycle Codecov test coverage Travis-CI Build Status

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

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 Tchetgen and Coull (2006):

Tchetgen 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:

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

test_results <- 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:

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

Please see the Introduction vignette for a working example.

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:

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.



BarkleyBG/glmerGOF documentation built on July 18, 2019, 6:43 p.m.