Learn R Programming

rddapp (version 1.2.1)

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"),
  methodname = c("Param", "bw", "Half-bw", "Double-bw"),
  gran = 10,
  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"), which denotes the complete model, heterogeneous treatment model and treatment only model respectively.

methodname

Option for method specification, one of c("Param", "bw", "Half-bw", "Double-bw").

gran

Granularity of the surface grid i.e. desired number of predicted points before and after the cutoff along each assignment variable.

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", "Param")
# }

Run the code above in your browser using DataLab