View source: R/rdhte_contrast.R
| rdhte_contrast | R Documentation |
rdhte_contrast refits an rdhte model at the
MSE-optimal bandwidth for a single user-chosen linear combination of the
Estimate vector and returns the resulting point estimate, robust
bias-corrected estimate, standard error, p-value, and confidence interval.
rdhte_contrast(model, contrast, refit = TRUE, level = 95, tol = 1e-10)
model |
A fitted model returned by |
contrast |
Numeric vector with length equal to |
refit |
Logical. |
level |
Confidence level in percentage form, in |
tol |
Tolerance below which the estimated contrast bias is treated as zero and the contrast-targeted bandwidth is declared undefined. |
Use rdhte_lincom instead when you want joint Wald inference on
several linear restrictions at one bandwidth.
A list with the conventional estimate, robust bias-corrected estimate,
robust standard error, z-statistic, p-value, confidence interval, selected
bandwidth, pilot bandwidth, contrast diagnostics, and (when
refit = TRUE) the refitted rdhte object.
rdhte, rdhte_lincom
## Not run:
set.seed(123)
n <- 1000
X <- runif(n, -1, 1)
W <- rbinom(n, 1, 0.5)
Y <- 3 + 2 * X + 1.5 * X^2 + 3 * W * (X >= 0) + rnorm(n)
m <- rdhte(y = Y, x = X, covs.hte = factor(W))
rdhte_contrast(m, contrast = c(-1, 1))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.