select_interaction: Create tibble of all potential pressure combinations to test...

Description Usage Arguments Details Value Examples

View source: R/select_interaction.R

Description

select_interaction is a helper function that creates a tibble with all indicator-specific combinations of pressures pairs as input for the test_interaction function. The pressures in the IND~pressure GAM(M)s are combined with all other pressures in the model tibble. If specific combinations should not be modeled simply delete them from this data frame.

Usage

1

Arguments

mod_tbl

A model output tibble from model_gam, select_model, merge_models or calc_deriv representing the best model for each IND~pressure pair.

Details

For each IND~pressure pair specific pressures to test for interactions can be selected by creating a tibble containing the IND (termed 'ind'), the pressure 1 (termed 'press') and the pressure 2 (termed 't_var'). The easiest is to use the helper function select_interaction: it creates all combinations of IND~press pairs and the threshold variables based on the input model tibble. If specific combinations should not be modeled simply delete them from this data frame.

Value

The functions returns a tibble with three columns:

ind

The name of the indicator

press

The pressure name for the smooth term

t_var

The pressure name for the threshold variable

Examples

1
2
# Using some models of the Baltic Sea demo data
test <- select_interaction(mod_tbl = merge_models_ex[1:5,])

saskiaotto/INDperform documentation built on Oct. 27, 2021, 10:33 p.m.