predict.rd: Predict the Regression Discontinuity

View source: R/predict.rd.R

predict.rdR Documentation

Predict the Regression Discontinuity

Description

predict.rd makes predictions of means and standard deviations of RDs at different cutoffs.

Usage

## S3 method for class 'rd'
predict(object, gran = 50, ...)

Arguments

object

An rd object, typically the result of rd_est.

gran

A non-negative integer specifying the granularity of the data points (i.e. the desired number of predicted points). The default is 50.

...

Additional arguments passed to predict.

Examples

set.seed(12345)
x <- runif(1000, -1, 1)
cov <- rnorm(1000)
y <- 3 + 2 * x + 3 * cov + 10 * (x >= 0) + rnorm(1000)
tr <- as.integer(x >= 0)
rd <- rd_est(y ~ x + tr | cov, cutpoint = 0, t.design = "geq") 
predict(rd)

rddapp documentation built on April 6, 2023, 1:15 a.m.