RealEffectText: Your personal glmmTMB model interpreter

View source: R/RealEffectText.R

RealEffectTextR Documentation

Your personal glmmTMB model interpreter

Description

This function generates a sentence describing the effect of a model predictor on the response variable. If model estimates are scaled and use a log link, this function can give "unscaled" effects of a predictor on the response variable.

Usage

RealEffectText(
  Model,
  Predictor,
  UnitChange = 1,
  ConfInt = 95,
  ScaleSds = NULL,
  PredVect = NULL,
  UnitSymb = "unit"
)

Arguments

Model

The unquoted name of the model object of interest.

Predictor

A character string representing the predictor of interest. Appropriate values can be found by entering row.names(summary(x)$coeff$cond) in the console, where x is the model of interest.

UnitChange

A number indicating the unscaled change in a predictor for which an effect should be returned.

ConfInt

A number indicating the desired confidence interval as a percent value.

ScaleSds

A number indicating how many standard deviations a predictor has been scaled by.

PredVect

The unquoted name of a vector containing the raw data for the predictor of interest.

UnitSymb

A character string representing the units of the precictor of interest.

Value

This function returns a sentence describing the effect of a specified change in a predictor on the response variable.

Examples

#The effect of a 10% change increase in
#moon face illumination on Epfu activity

data("Epfu_Nb2_Long", "BatDataLong", package = "EcoCountHelper")

RealEffectText(Epfu_Nb2_Long, "MoonScale",
                0.1, ScaleSds = 2,
                PredVect = BatDataLong$MoonPct)


huntercole25/EcoCountHelper documentation built on Jan. 14, 2023, 4:13 a.m.