RealEffectText: Your personal glmmTMB model interpreter

Description Usage Arguments Value Examples

View source: R/RealEffectText.R

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

1
2
3
4
5
6
7
8
9
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

1
2
3
4
5
6
7
8
#The effect of a 10% change increase in
#moon face illumination on Epfu activity

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

RealEffectText(EpfuNb2Long, "scale2(MoonPct)",
                0.1, ScaleSds = 2,
                PredVect = BatDataLong$MoonPct)

huntercole25/EcoCountHelper documentation built on July 21, 2020, 8:56 p.m.