Learn R Programming

vinereg (version 0.11.0)

plot_effects: Plot marginal effects of a D-vine regression model

Description

The marginal effects of a variable is the expected effect, where expectation is meant with respect to all other variables.

Usage

plot_effects(object, alpha = c(0.1, 0.5, 0.9), vars = object$order)

Arguments

object

a vinereg object

alpha

vector of quantile levels.

vars

vector of variable names.

Examples

Run this code
# simulate data
x <- matrix(rnorm(100), 50, 2)
y <- x %*% c(1, -2)
dat <- data.frame(y = y, x = x, z = as.factor(rbinom(50, 2, 0.5)))

# fit vine regression model
fit <- vinereg(y ~ ., dat)
plot_effects(fit)

Run the code above in your browser using DataLab