Learn R Programming

clogitboost (version 1.1)

marginal: Marginal utility for clogitboost objects

Description

marginal function for the clogitboost objects, which produces the marginal utility values of a covariate.

Usage

marginal(x, grid, d)

Arguments

x
output object from the clogitboost function.
d
integer indicating which covariate is used.
grid
grid of values for predicting the marginal utilities.

Value

The method marginal returns a vector of predicted marginal utilities based on the grid input.

See Also

clogitboost

Examples

Run this code
data(travel)
train <- 1:504
y <- travel$MODE[train]
x <- travel[train, 3:6]
strata <- travel$Group[train]
fit <- clogitboost(y = y, x = x, strata = strata, iter = 10, rho = 0.05)
marginal(fit, grid = seq(0, 10, by = 1), d = 1)

Run the code above in your browser using DataLab