calc_pred: Calculate predicted values and their confidence intervals for...

Description Usage Arguments Value See Also Examples

View source: R/calc_pred.R

Description

calc_pred is a helper function for model_trend, model_gam, model_gamm and plot_model. It calculates for a list of Generalized Additive (Mixed) Models the predicted IND values as well as the upper and lower 95% confidence intervals based on a list of corresponding pressure values (observed or a regular spaced sequence).

Usage

1
calc_pred(model_list, obs_press)

Arguments

model_list

A list of model objects of class 'gam' or 'gamm'.

obs_press

A list of vectors with pressure values (observed or an artificial sequence).

Value

The function returns a tibble with one row for each model and three columns:

pred

A list-column with the predicted IND values given the input pressure values.

ci_up

A list-column with the upper 95% confidence limit of the IND predictions.

ci_low

A list-column with the lower 95% confidence limit of the IND predictions.

See Also

model_trend, model_gam, model_gamm, plot_model

Examples

1
2
3
4
# Using the Baltic Sea demo data
model_list <- model_gam_ex$model
obs_press <- ind_init_ex$press_train
x <- calc_pred(model_list, obs_press)

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