wt_kern_bivariate: Bivariate Kernel Weight Calculation

View source: R/wt_kern_bivariate.R

wt_kern_bivariateR Documentation

Bivariate Kernel Weight Calculation

Description

wt_kern_bivariate calculates the appropriate weights for two variables for Multivariate Frontier Regression Discontinuity Estimation with nonparametric implementation. Kernel weights are calculated based on the L1 distance of the two variables from the frontiers. This is an internal function and is typically not directly invoked by the user. It can be accessed using the triple colon, as in rddapp:::wt_kern_bivariate().

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; the first assignment variable in an MRDD.

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.; the second assignment variable in an MRDD.

center1

A numeric value specifying the point from which distances should be calculated for the first vector, X1.

center2

A numeric value specifying the point from which distances should be calculated for the second vector, X2.

bw

A numeric vector specifying the bandwidths for each of three effects models (complete model, heterogeneous treatment model, and treatment only model) detailed in Wong, Steiner, and Cook (2013).

kernel

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

t.design

A character vector of length 2 specifying the treatment option according to design. The first entry is for x1 and the second entry is for x2. Options are "g" (treatment is assigned if x1 is greater than its cutoff), "geq" (treatment is assigned if x1 is greater than or equal to its cutoff), "l" (treatment is assigned if x1 is less than its cutoff), and "leq" (treatment is assigned if x1 is less than or equal to its cutoff). The same options are available for x2.

Value

wt_bivariate_kern returns a matrix 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.


rddapp documentation built on March 18, 2022, 6:39 p.m.