An open API service indexing awesome lists of open source software.

https://github.com/anestistouloumis/multgee

GEE solver for correlated nominal or ordinal multinomial responses using a local odds ratios parameterization.
https://github.com/anestistouloumis/multgee

gee multinomial r

Last synced: about 1 month ago
JSON representation

GEE solver for correlated nominal or ordinal multinomial responses using a local odds ratios parameterization.

Awesome Lists containing this project

README

        

---
output: github_document
references:
- id: Touloumis2015
title: "R Package multgee: A Generalized Estimating Equations Solver for Multinomial Responses"
author:
- family: Touloumis
given: Anestis
container-title: Journal of Statistical Software
volume: 64
URL: 'https://www.jstatsoft.org/v064/i08'
issue: 8
page: 1-14
type: article-journal
issued:
year: 2015
- id: Touloumis2013
title: "GEE for Multinomial Responses Using a Local Odds Ratios Parameterization"
author:
- family: Touloumis
given: Anestis
- family: Agresti
given: Alan
- family: Kateri
given: Maria
container-title: Biometrics
volume: 69
URL: 'https://onlinelibrary.wiley.com/doi/10.1111/biom.12054/full'
issue: 3
page: 633--640
type: article-journal
issued:
year: 2013
csl: biometrics.csl
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
tidy = TRUE,
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

# multgee: GEE Solver for Correlated Nominal or Ordinal Multinomial Responses
[![Github version](`r paste0("https://img.shields.io/badge/GitHub%20-", as.vector(read.dcf('DESCRIPTION')[, 'Version']),"-orange.svg")`)]("commits/master")
[![R-CMD-check](https://github.com/AnestisTouloumis/multgee/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/AnestisTouloumis/multgee/actions/workflows/R-CMD-check.yaml)
[![Project Status: Active The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)

[![CRAN Version](https://www.r-pkg.org/badges/version/multgee?color=blue)](https://cran.r-project.org/package=multgee)
[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/grand-total/multgee?color=blue)](https://cranlogs.r-pkg.org/badges/grand-total/multgee)
[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/multgee)](https://cran.r-project.org/package=multgee)

## Installation
You can install the release version of `multgee`:

```{r eval=FALSE}
install.packages("multgee")
```

The source code for the release version of `multgee` is available on CRAN at:

- https://CRAN.R-project.org/package=multgee

Or you can install the development version of `multgee`:

```{r eval=FALSE}
# install.packages("devtools")
devtools::install_github("AnestisTouloumis/multgee")
```

The source code for the development version of `multgee` is available on github at:

- https://github.com/AnestisTouloumis/multgee

To use `multgee`, you should load the package as follows:

```{r}
library("multgee")
```

## Usage
This package provides a generalized estimating equations (GEE) solver for fitting marginal regression models with correlated nominal or ordinal multinomial responses based on a local odds ratios parameterization for the association structure [see @Touloumis2013].

There are two core functions to fit GEE models for correlated multinomial responses:

- `ordLORgee` for an ordinal response scale. Options for the marginal model include cumulative link models or an adjacent categories logit model,
- `nomLORgee` for a nominal response scale. Currently, the only option is a marginal baseline category logit model.

The main arguments in both functions are:

- an optional data frame (`data`),
- a model formula (`formula`),
- a cluster identifier variable (`id`),
- an optional vector that identifies the order of the observations within each cluster (`repeated`).

The association structure among the correlated multinomial responses is expressed via marginalized local odds ratios [@Touloumis2013]. The estimating procedure for the local odds ratios can be summarized as follows: For each level pair of the `repeated` variable, the available responses are aggregated across clusters to form a square marginalized contingency table. Treating these tables as independent, an RC-G(1) type model is fitted in order to estimate the marginalized local odds ratios. The `LORstr` argument determines the form of the marginalized local odds ratios structure. Since the general RC-G(1) model is closely related to the family of association models, one can instead fit an association model to each of the marginalized contingency tables by setting `LORem = "2way"` in the core functions.

There are also five useful utility functions:

- `confint` for obtaining Wald--type confidence intervals for the regression parameters using the standard errors of the sandwich (`method = "robust"`) or of the model--based (`method = "naive"`) covariance matrix. The default option is the sandwich covariance matrix (`method = "robust"`),
- `waldts` for assessing the goodness-of-fit of two nested GEE models based on a Wald test statistic,
- `vcov` for obtaining the sandwich (`method = "robust"`) or model--based (`method = "naive"`) covariance matrix of the regression parameters,
- `intrinsic.pars` for assessing whether the underlying association structure does not change dramatically across the level pairs of `repeated`,
- `gee_criteria` for reporting commonly used criteria to select variables and/or association structure for GEE models.

## Example
The following R code replicates the GEE analysis presented in @Touloumis2013.
```{r}
data("arthritis")
intrinsic.pars(y, arthritis, id, time, rscale = "ordinal")
```

The intrinsic parameters do not differ much. This suggests that the uniform local odds ratios structure might be a good approximation for the association pattern.

```{r}
fitord <- ordLORgee(formula = y ~ factor(time) + factor(trt) + factor(baseline),
data = arthritis, id = id, repeated = time)
summary(fitord)
```

The 95\% Wald confidence intervals for the regression parameters are
```{r}
confint(fitord)
```

To illustrate model comparison, consider another model with `age` and `sex` as additional covariates:
```{r}
fitord1 <- update(fitord, formula = . ~ . + age + factor(sex))
waldts(fitord, fitord1)
gee_criteria(fitord, fitord1)
```
According to the Wald test, there is no evidence of no difference between the two models. The QICu criterion suggest that `fitord` should be preferred over `fitord1`.

## Getting help
The statistical methods implemented in `multgee` are described in @Touloumis2013. A detailed description of the functionality of `multgee` can be found in @Touloumis2015. Note that an updated version of this paper also serves as a vignette:

```{r eval=FALSE}
browseVignettes("multgee")
```

## How to cite
```{r echo=FALSE, comment=""}
print(citation("multgee"), bibtex = TRUE)
```

# References