Learn R Programming

ocf (version 1.0.3)

plot.ocf.marginal: Plot Method for ocf.marginal Objects

Description

Plots an ocf.marginal object.

Usage

# S3 method for ocf.marginal
plot(x, ...)

Value

Plots an ocf.marginal object.

Arguments

x

An ocf.marginal object.

...

Further arguments passed to or from other methods.

Author

Riccardo Di Francesco

Details

If standard errors have been estimated, 95% confidence intervals are shown.

References

  • Di Francesco, R. (2025). Ordered Correlation Forest. Econometric Reviews, 1–17. tools:::Rd_expr_doi("10.1080/07474938.2024.2429596").

See Also

ocf, marginal_effects.

Examples

Run this code
## Generate synthetic data.
set.seed(1986)

data <- generate_ordered_data(100)
sample <- data$sample
Y <- sample$Y
X <- sample[, -1]

## Fit ocf.
forests <- ocf(Y, X)

## Marginal effects at the mean.
me <- marginal_effects(forests, eval = "atmean")
plot(me)

## Add standard errors.
honest_forests <- ocf(Y, X, honesty = TRUE)
honest_me <- marginal_effects(honest_forests, eval = "atmean", inference = TRUE)
plot(honest_me)

Run the code above in your browser using DataLab