modsol_RD: Modulus of Continuity for the RD Parameter

View source: R/mod_calc_RD.R

modsol_RDR Documentation

Modulus of Continuity for the RD Parameter

Description

Calculates the modulus of continuity for the RD parameter.

Usage

modsol_RD(delta, C_pair, Xt, Xc, mon_ind, sigma_t, sigma_c, swap = FALSE)

Arguments

delta

a nonnegative value of δ.

C_pair

a pair of smoothness parameters (C, C').

Xt

n_t by k design matrix for the treated units.

Xc

n_c by k design matrix for the control units.

mon_ind

index number for monotone variables.

sigma_t

standard deviation of the error term for the treated units (either length 1 or n_t).

sigma_c

standard deviation of the error term for the control units (either length 1 or n_c).

swap

indicator for whether we take (C', C) instead of (C, C').

Value

A list of four components. bt gives the modulus value corresponding to the treated observations, while delta_t gives the value of the inverse modulus corresponding to the treated observations. bc and delta_c give the analogous values for the control observations.

Examples

n <- 500
d <- 2
X <- matrix(rnorm(n * d), nrow = n, ncol = d)
tind <- X[, 1] < 0 & X[, 2] < 0
Xt <- X[tind == 1, ,drop = FALSE]
Xc <- X[tind == 0, ,drop = FALSE]
C_pair <- c(0.1, 0.2)
mon_ind <- c(1, 2)
sigma <- rnorm(n)^2 + 1
sigma_t <- sigma[tind == 1]
sigma_c <- sigma[tind == 0]
modsol_RD(1, C_pair, Xt, Xc, mon_ind, sigma_t, sigma_c, swap = FALSE)
C_pair[1] <- Inf
modsol_RD(1, C_pair, Xt, Xc, mon_ind, sigma_t, sigma_c, swap = FALSE)

koohyun-kwon/rdadapt documentation built on May 8, 2022, 8:49 p.m.