Learn R Programming

groupedstats (version 0.0.9)

grouped_glmer: Function to run generalized linear mixed-effects model (glmer) across multiple grouping variables.

Description

Function to run generalized linear mixed-effects model (glmer) across multiple grouping variables.

Usage

grouped_glmer(data, grouping.vars, ..., output = "tidy",
  tidy.args = list(conf.int = TRUE, conf.level = 0.95),
  augment.args = list())

Arguments

data

Dataframe (or tibble) from which variables are to be taken.

grouping.vars

Grouping variables.

...

Arguments to function.

These dots support tidy-dots features.

output

A character describing what output is expected. Two possible options: "tidy" (default), which will return the results, or "glance", which will return model summaries.

tidy.args

A list of arguments to be used in the relevant S3 method.

augment.args

A list of arguments to be used in the relevant S3 method.

Value

A tibble dataframe with tidy results from linear model or model summaries.

See Also

grouped_lmer

Examples

Run this code
# NOT RUN {
# for reproducibility
set.seed(123)

# categorical outcome; binomial family
groupedstats::grouped_glmer(
  formula = Survived ~ Age + (Age | Class),
  family = stats::binomial(link = "probit"),
  data = dplyr::sample_frac(groupedstats::Titanic_full, size = 0.3),
  grouping.vars = Sex
)
# }

Run the code above in your browser using DataLab