resid_calc: Residual calculation function

Description Usage Arguments Value

View source: R/cond_var.R

Description

Calculates residuals corresponding to each observations.

Usage

1
resid_calc(y, x, d = NULL, deg, kern = "epa", var.reg = "npr")

Arguments

y

dependent variable; possibly a matrix with nrow(y) equals the number of observations.

x

a vector of independent variable

d

a vector of treatment indicator; it can be arbitrarily specified when not used.

deg

degree of local polynomial regression to be used

kern

kernel used to calculate conditional variance function; supports "tri", "epa", "uni", and "gau". Default is kern = "epa".

var.reg

nonparametric regression method used to calculate residuals; either "npr" (standing for nprobust package) or "locpol" (standing for locpol package). Default is var.reg = "npr".

Value

a list of residuals corresponding to treated individuals (resid.1) and control individuals (resid.0); if there is no control group, resid.0 = 0 is returned.


koohyun-kwon/HTEBand documentation built on Dec. 21, 2021, 7:42 a.m.