Learn R Programming

stgam (version 1.2.0)

effect_size: Quantifies the relative effect sizes of each component of zmgcv` GAM model.

Description

Quantifies the relative effect sizes of each component of zmgcv` GAM model.

Usage

effect_size(mgcv_model, digits = 3)

Value

a matrix of the model terms, the size of the effect (range) ad standard deviation (sd)

Arguments

mgcv_model

a GAM model created by the mgcv package

digits

the number of significant figures of uysed to report effect size

Examples

Run this code
require(dplyr)
require(stringr)
require(purrr)
require(doParallel)

# define input data
data("chaco")
m <- gam(
ndvi ~
  te(X,Y, by = tmax) +
  s(X,Y, by = pr),
 data = chaco,
 method = "REML",
 family = gaussian()
)
# examine the effect size
effect_size(m, 3)

Run the code above in your browser using DataLab