glmm_nb_lmer: Pseudo-Likelihood Negative Binomial Mixed Model

glmm_nb_lmerR Documentation

Pseudo-Likelihood Negative Binomial Mixed Model

Description

This function fits a negative binomial mixed model using a psuedo-likelihood approach

Usage

glmm_nb_lmer(
  formula,
  data,
  niter = 40,
  epsilon = 1e-08,
  verbose = FALSE,
  REML = TRUE
)

Arguments

formula

A two-sided linear formula describing both the fixed-effects and random-effects parts of the model using the syntax of the lme4 package.

data

An optional data frame containing the model variables.

niter

Maximum number of iterations.

epsilon

Positive convergence tolerance.

verbose

Logical. Should the number of iterations and computational time be printed?

REML

Logical. Should the models be fit with REML or regular ML?

Details

#' This function is similar to the function glmm.nb from the NBZIMM package, though it utilizes the lmerTest package rather than nlme package and returns and object compatible with the pkrtest package which allows for the calculation of Kenward-Roger degrees of freedom. (see krmodcomp, contest.lmerModLmerTest)

Value

An object of class glmm_nb_mod

Author(s)

Elizabeth Wynn and Camille Moore, underlying code drawn from code by NBZIMM-authors.

References

Zhang X, Mallick H, Tang Z, Zhang L, Cui X, Benson AK, Yi N (2017). "Negative binomial mixed models for analyzing microbiome count data." BMC Bioinformatics, 18(1), 4. ISSN 14712105. doi:10.1186/s12859-016-1441-7

See Also

glmm_nb_mod, lmer

Examples

data("simdata")
sample_meta_data <- simdata$metadata

#Subset down to one observation (i.e. gene)
counts=simdata$counts[1,]

#Combine counts, metadata into dataframe
df=cbind(counts, sample_meta_data)

#Fit the Model
fit.glmm.nb <- glmm_nb_lmer(formula =counts ~ group * time + (1|ids),
                            data=df, REML = T)

ewynn610/corrRNASeq documentation built on Sept. 29, 2023, 10:37 a.m.