plot_predVSobs: Plot predictions vs real observations for 'pffr' models

Description Usage Arguments

View source: R/effect_plots.R

Description

Plots the predictions o a function-on-scalar model fitted with pffr agains the real observations.

Usage

1
2
3
4
plot_predVSobs(model, data, yvar, yvar_label, type = "response",
  log10 = FALSE, pi_type = "none", pi_alpha = 0.05, base_size = 11,
  xlab = "yindex", ylab, main = "Prediction vs observation", ybreaks,
  ylabels, ylim = NULL, lwd = 1, legend_symbol_size = 2, ...)

Arguments

model

Function-on-scalar model fitted with pffr

data

Dataset with one row for which the predictions are to be plotted

yvar

name of the response variable in model

yvar_label

Optional label of the response variable used for plot annotation

type

"response" (default) or "link". See predict.pffr.

log10

If TRUE the predictions are shown on a log10 scale

pi_type

One of "none" (default; no uncertainty bands), "pi_norm" or "pi_gamma" (pointwise prediction intervals), specifying which type of uncertainty bands should be plotted. Prediction intervals are either calculated summing the predicted mean variance and the residual variance ("pi_norm") or using 'posterior simulation' of the parameter vector ("pi_gamma") as outlined here: https://stat.ethz.ch/pipermail/r-help/2011-April/275632.html. Note that the "pi_norm" PIs are not generally applicable for generalized models. The posterior simulation approach is more generally applicable, but is currently only implemented for Gamma regression.

pi_alpha

If pi_type != "none", 1-pi_alpha% prediction intervals are plotted. Defaults to 0.05.

base_size

Base size of plot elements, see theme_bw. Defaults to 11.

xlab, ylab, main

Optional arguments for plot annotation

ybreaks, ylabels

Optional specification of the tick position and the corresponding labels (character vector) for the y axis

ylim

Optional y axis limits of plot

lwd

Optional line width. Defaults to 2

legend_symbol_size

Optional size of symbols in legend.

seed

Additional arguments passed to pi_gamma


bauer-alex/FoSIntro documentation built on Feb. 11, 2022, 8:33 a.m.