print.aggTrees.inference {aggTrees}R Documentation

Print Method for aggTrees.inference Objects

Description

Prints an aggTrees.inference object.

Usage

## S3 method for class 'aggTrees.inference'
print(x, table = "avg_char", ...)

Arguments

x

aggTrees.inference object.

table

Either "avg_char" or "diff", controls which table must be produced.

...

Further arguments passed to or from other methods.

Details

A description of each table is provided in its caption.

Some covariates may feature zero variation in some leaf. This generally happens to dummy variables used to split some nodes. In this case, when table == "avg_char" a warning message is produced displaying the names of the covariates with zero variation in one or more leaves. The user should correct the table by removing the associated standard errors.

Compilation of the LATEX code requires the following packages: booktabs, float, adjustbox, multirow.

Value

Prints LATEX code.

Author(s)

Riccardo Di Francesco

References

See Also

build_aggtree, inference_aggtree

Examples


## Generate data.
set.seed(1986)

n <- 1000
k <- 3

X <- matrix(rnorm(n * k), ncol = k)
colnames(X) <- paste0("x", seq_len(k))
D <- rbinom(n, size = 1, prob = 0.5)
mu0 <- 0.5 * X[, 1]
mu1 <- 0.5 * X[, 1] + X[, 2]
y <- mu0 + D * (mu1 - mu0) + rnorm(n)

## Construct sequence of groupings. CATEs estimated internally,
groupings <- build_aggtree(y, D, X, method = "aipw")

## Analyze results with 4 groups.
results <- inference_aggtree(groupings, n_groups = 4)

## Print results.
print(results, table = "diff")
print(results, table = "avg_char")


[Package aggTrees version 2.0.2 Index]