rddapp (version 1.1.0)

plot.mfrd: Plot the Multivariate Frontier Regression Discontinuity

Description

plot.mfrd plots the 3D illustration of the bivariate frontier RDD.

Usage

# S3 method for mfrd
plot(x, model = c("m_s", "m_h", "m_t"), gran = 2,
  raw_data = TRUE, color_surface = FALSE, ...)

Arguments

x

An mfrd object returned by mfrd_est or contained in the object returned by mrd_est.

model

Option for the model specification, one of c("m_s", "m_h", "m_t").

gran

Granularity of the surface grid.

raw_data

Whether the raw data points are plotted.

color_surface

Whether the treated surface is colored.

...

Additional graphic arguments passed to persp.

Examples

Run this code
# NOT RUN {
set.seed(12345)
x1 <- runif(1000, -1, 1)
x2 <- runif(1000, -1, 1)
cov <- rnorm(1000)
y <- 3 + 2 * (x1 >= 0) + 3 * cov + 10 * (x2 >= 0) + rnorm(1000)
model <- mfrd_est(y = y, x1 = x1, x2 = x2, c1 = 0, c2 = 0, t.design = c("geq", "geq"))
plot(model, "m_s")
# }

Run the code above in your browser using DataCamp Workspace