Learn R Programming

rddapp (version 1.2.1)

wt_kern_bivariate: Bivariate Kernel Weight Calculation

Description

wt_kern_bivariate calculates the appropriate weights for two variables for nonparametric implementation of Multivariate Frontier Regression Discontinuity Estimation. Kernel weights are calculated based on the L1 distance of the two variables from the frontiers.

Usage

wt_kern_bivariate(
  X1,
  X2,
  center1,
  center2,
  bw,
  kernel = "triangular",
  t.design = NULL
)

Arguments

X1

The input x1 values for the first vector. This variable represents the axis along which kernel weighting should be performed.

X2

The input x2 values for the second vector. X2 has the same length as X1. This variable represents the axis along which kernel weighting should be performed.

center1

The point from which distances should be calculated for the first vector.

center2

The point from which distances should be calculated for the second vector.

bw

A numeric vector specifying the bandwidths for each of three effects models

kernel

A string indicating the kernel to use. Options are "triangular" (the default), "epanechnikov", "quartic", "triweight", "tricube", "gaussian", and "cosine".

t.design

The treatment option according to design. The 1st entry is for X1: "g" means treatment is assigned if X1 is greater than its cutoff, "geq" means treatment is assigned if X1 is greater than or equal to its cutoff, "l" means treatment is assigned if X1 is less than its cutoff, "leq" means treatment is assigned if X1 is less than or equal to its cutoff. The 2nd entry is for X2.

Value

Three vectors of weights and distances with length equal to that of the X1 and X2 input. The first and second weights and distances are calculated with respect to all frontiers of different treatments. The third weight and distance are calculated with respect to the overall frontier of treatment versus non-treatment.