print.morf.marginal: Print Method for morf.marginal Objects

View source: R/generic-s3.R

print.morf.marginalR Documentation

Print Method for morf.marginal Objects

Description

Prints an morf.marginal object.

Usage

## S3 method for class 'morf.marginal'
print(x, latex = FALSE, ...)

Arguments

x

An morf.marginal object.

latex

If TRUE, prints LATEX code.

...

Further arguments passed to or from other methods.

Details

Compilation of the LATEX code requires the following packages: booktabs, float, adjustbox. If standard errors have been estimated, they are printed in parenthesis below each point estimate.

Value

Prints an morf.marginal object.

Author(s)

Riccardo Di Francesco

See Also

morf, marginal_effects.

Examples

## Load data from orf package.
set.seed(1986)

library(orf)
data(odata)
odata <- odata[1:200, ] # Subset to reduce elapsed time.

y <- as.numeric(odata[, 1])
X <- as.matrix(odata[, -1])

## Fit morf. Use large number of trees.
forests <- morf(y, X, n.trees = 4000)

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


## Add standard errors.
honest_forests <- morf(y, X, n.trees = 4000, honesty = TRUE)
honest_me <- marginal_effects(honest_forests, eval = "atmean", inference = TRUE)
print(honest_me, latex = TRUE)


morf documentation built on March 31, 2023, 8:14 p.m.