Learn R Programming

rddtools (version 2.0.2)

dens_test: McCrary Sorting Test

Description

This calls the original DCdensity function which was in the package rdd by Drew Dimmery, which has been archived and is now internally stored in the Rddtools package.

Usage

dens_test(rdd_object, bin = NULL, bw = NULL, plot = TRUE, ...)

Arguments

rdd_object

object of class rdd_data

bin

the binwidth (defaults to 2*sd(runvar)*length(runvar)^(-.5))

bw

the bandwidth to use (by default uses bandwidth selection calculation from McCrary (2008))

plot

Whether to return a plot. Logical, default to TRUE.

...

Further arguments passed to the unexported DCdensity function.

Details

Run the McCracy test for manipulation of the forcing variable

References

McCrary, Justin. (2008) "Manipulation of the running variable in the regression discontinuity design: A density test," Journal of Econometrics. 142(2): 698-714. tools:::Rd_expr_doi("http://dx.doi.org/10.1016/j.jeconom.2007.05.005")

Examples

Run this code
data(house)
house_rdd <- rdd_data(y=house$y, x=house$x, cutpoint=0)
dens_test(house_rdd)

Run the code above in your browser using DataLab