knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of HTEBand is to construct uniform confidence bands for conditional expectation functions and conditional average treatment effect functions.
You can install the development version from GitHub with:
install.packages("remotes") # if not installed remotes::install_github("koohyun-kwon/HTEBand")
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
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)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.