plot_pred {lgpr}R Documentation

Visualizing model predictions or inferred covariate effects

Description

Usage

plot_pred(
  fit,
  pred = NULL,
  group_by = "id",
  t_name = "age",
  MULT_STD = 2,
  verbose = TRUE,
  draws = NULL,
  reduce = function(x) base::mean(x),
  x = NULL,
  ...
)

plot_f(
  fit,
  pred = NULL,
  group_by = "id",
  t_name = "age",
  MULT_STD = 2,
  verbose = TRUE,
  draws = NULL,
  reduce = function(x) base::mean(x),
  comp_idx = NULL,
  color_by = NA,
  x = NULL,
  ...
)

Arguments

fit

An object of class lgpfit.

pred

An object of class GaussianPrediction or Prediction. If pred=NULL, the pred function is called with the given reduce and draws arguments.

group_by

name of the grouping variable (use group_by=NA to avoid grouping)

t_name

name of the x-axis variable

MULT_STD

a multiplier for standard deviation

verbose

Can this print any messages?

draws

Only has effect if pred=NULL.

reduce

Only has effect if pred=NULL.

x

Deprecated argument. This is now taken from the pred object to ensure compatibility.

...

additional arguments to plot_api_g or plot_api_c

comp_idx

Index of component to plot. The total sum is plotted if this is NULL.

color_by

name of coloring factor

Value

a ggplot object

See Also

Other main plot functions: plot_components(), plot_draws()


[Package lgpr version 1.2.4 Index]