glmm_nb_lmer | R Documentation |
This function fits a negative binomial mixed model using a psuedo-likelihood approach
glmm_nb_lmer(
formula,
data,
niter = 40,
epsilon = 1e-08,
verbose = FALSE,
REML = TRUE
)
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? |
#' 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
)
An object of class glmm_nb_mod
Elizabeth Wynn and Camille Moore, underlying code drawn from code by NBZIMM-authors.
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
glmm_nb_mod
, lmer
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.