set_mean: Obtain mean values and reference categories of variables in a...

View source: R/set_mean.R

set_meanR Documentation

Obtain mean values and reference categories of variables in a data.frame

Description

This function purely exists for the set_mean argument of plot_moments. It takes a data.frame and obtains the mean values (numeric variables) and reference categories (categorical covariates).

Usage

set_mean(input, vary_by = NULL)

Arguments

input

A data.frame object

vary_by

A character string with the name of a variable over which the output dataframe should vary.

Value

A data.frame object with one row

Examples


library("betareg")

# Get some data
beta_dat <- model_fam_data(fam_name = "betareg")

# Estimate model
betamod <- betareg(betareg ~ ., data = beta_dat)

# Obtain explanatory variables and set to mean
set_mean(model_data(betamod))
set_mean(model_data(betamod), vary_by = "binomial1")

distreg.vis documentation built on Oct. 27, 2023, 9:07 a.m.