Description Usage Arguments Details Value References Examples
Compute RDD estimate allowing a locally kernel weighted version of any estimation function possibly on the range specified by bandwidth
1 2 3 4 5 6 7 8 9 10 11 12 |
rdd_object |
Object of class rdd_data created by |
fun |
The function to estimate the parameters |
covariates |
Formula to include covariates |
order |
Order of the polynomial regression. |
bw |
A bandwidth to specify the subset on which the kernel weighted regression is estimated |
slope |
Whether slopes should be different on left or right (separate), or the same. |
covar.opt |
Options for the inclusion of covariates. Way to include covariates, either in the main regression ( |
weights |
Optional weights to pass to the lm function. Note this cannot be entered together with |
... |
Further arguments passed to fun. See the example. |
This function allows the user to use a custom estimating function, instead of the traditional lm()
.
It is assumed that the custom funciton has following behaviour:
A formula interface, together with a data
argument
A weight
argument
A coef(summary(x)) returning a data-frame containing a column Estimate
Note that for the last requirement, this can be accomodated by writing a specific rdd_coef
function for the class of the object returned by fun
.
An object of class rdd_reg_lm and class lm, with specific print and plot methods
TODO
1 2 3 4 5 6 7 8 9 | ## Step 0: prepare data
data(house)
house_rdd <- rdd_data(y=house$y, x=house$x, cutpoint=0)
## Estimate a local probit:
house_rdd$y <- with(house_rdd, ifelse(y<quantile(y, 0.25), 0,1))
reg_bin_glm <- rdd_gen_reg(rdd_object=house_rdd, fun= glm, family=binomial(link='probit'))
print(reg_bin_glm)
summary(reg_bin_glm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.