Learn R Programming

INDperform (version 0.2.2)

calc_pred: Calculate predicted values and their confidence intervals for GAM(M)s

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

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

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab