Learn R Programming

psycho (version 0.4.91)

get_means: Compute estimated means from models.

Description

Compute estimated means of factor levels based on a fitted model.

Usage

get_means(fit, formula = NULL, CI = 90, ...)

Arguments

fit

A model (lm, lme4 or rstanarm).

formula

A character vector (formula like format, i.e., including interactions or nesting terms) specifying the names of the predictors over which EMMs are desired.

CI

Determine the confidence or credible interval bounds.

...

Arguments passed to or from other methods. For instance, transform="response".

Value

Estimated means (or median of means for Bayesian models)

Examples

Run this code
# NOT RUN {
library(psycho)
require(lmerTest)
require(rstanarm)


fit <- glm(Sex ~ Birth_Season, data = affective, family = "binomial")
get_means(fit)

fit <- lmerTest::lmer(Adjusting ~ Birth_Season * Salary + (1 | Salary), data = affective)
get_means(fit, formula = "Birth_Season")

fit <- rstanarm::stan_glm(Adjusting ~ Birth_Season, data = affective)
get_means(fit, formula = "Birth_Season")
# }

Run the code above in your browser using DataLab