knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

HTEBand

The goal of HTEBand is to construct uniform confidence bands for conditional expectation functions and conditional average treatment effect functions.

Installation

You can install the development version from GitHub with:

install.packages("remotes") # if not installed
remotes::install_github("koohyun-kwon/HTEBand")

Instruction

For a conditional expectation function, use NpregBand command. For a conditional average treatment effect function, use CATEBand command. See help page of each function for details:

?HTEBand::NpregBand
?HTEBand::CATEBand

Example

Nonparametric regression via NpregBand:

library(HTEBand)
library(tidyverse)
x <- seq(-1, 1, length.out = 500)
y <- x^2 + rnorm(500, 0, 1/4)
cb.res <- NpregBand(y, x, 2, 0.95, "L", n.eval = 25, print.t = FALSE)
cb.res$fx <- (cb.res$eval)^2
ggplot(data = cb.res) + geom_line(aes(x = eval, y = cb.lower)) +
  geom_line(aes(x = eval, y = cb.upper)) + geom_line(aes(x = eval, y = fx), color = "red") +
  theme_bw() + xlab("x") + ylab("f(x)")


koohyun-kwon/HTEBand documentation built on Dec. 21, 2021, 7:42 a.m.