plot.vareffects: Plot predictions

View source: R/plotsfuns.R

plot.vareffectsR Documentation

Plot predictions

Description

Plots estimated conditional or marginal predictions.

Usage

## S3 method for class 'vareffects'
plot(
  x,
  ...,
  xlabs = NULL,
  ylabs = NULL,
  xtrans_fun = NULL,
  pos = 0.5,
  ci = TRUE,
  facet_scales = "fixed",
  facet_ncol = NULL
)

Arguments

x

varpred object

...

for future implementations

xlabs

x-axis label. If NULL, default, x.var is used.

ylabs

y-axis label. If NULL, default, the response label is used.

xtrans_fun

function to transform x values to the original or other scales. Useful when x was transformed prior to model fitting.

pos

spacing between labels of categorical variable on the plot.

Value

a ggplot object.

See Also

varpred

Examples

set.seed(4567)
x <- rnorm(100, 3, 5)
y <- 0.4 + 0.7*x + rnorm(100)
df <- data.frame(y = y, x = x)
m1 <- lm(y ~ x, df)

pred1 <- varpred(m1, "x")
plot(pred1)


mac-theobio/effects documentation built on July 6, 2023, 4:19 a.m.