Description Usage Arguments Value Author(s) References Examples
DCdensity implements the McCrary (2008) sorting test.
1 2  | 
runvar | 
 numerical vector of the running variable  | 
cutpoint | 
 the cutpoint (defaults to 0)  | 
bin | 
 the binwidth (defaults to   | 
bw | 
 the bandwidth to use (by default uses bandwidth selection calculation from McCrary (2008))  | 
verbose | 
 logical flag specifying whether to print diagnostic information to the terminal. (defaults to   | 
plot | 
 logical flag indicating whether to plot the histogram and density estimations (defaults to   | 
ext.out | 
 logical flag indicating whether to return extended output. When   | 
htest | 
 logical flag indicating whether to return an   | 
If ext.out is FALSE, only the p value will be returned. Additional output is enabled when ext.out is TRUE. In this case, a list will be returned with the following elements:
theta | 
 the estimated log difference in heights at the cutpoint  | 
se | 
 the standard error of   | 
z | 
 the z statistic of the test  | 
p | 
 the p-value of the test. A p-value below the significance threshhold indicates that the user can reject the null hypothesis of no sorting.  | 
binsize | 
 the calculated size of bins for the test  | 
bw | 
 the calculated bandwidth for the test  | 
cutpoint | 
 the cutpoint used  | 
data | 
 a dataframe for the binning of the histogram. Columns are   | 
Drew Dimmery <drewd@nyu.edu>
McCrary, Justin. (2008) "Manipulation of the running variable in the regression discontinuity design: A density test," Journal of Econometrics. 142(2): 698-714. http://dx.doi.org/10.1016/j.jeconom.2007.05.005
1 2 3 4 5 6 7 8  | 
Loading required package: sandwich
Loading required package: lmtest
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
    as.Date, as.Date.numeric
Loading required package: AER
Loading required package: car
Loading required package: survival
Loading required package: Formula
[1] 0.4929004
[1] 1.436159e-08
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.