dens_test: Run the McCracy test for manipulation of the forcing variable

Description Usage Arguments Examples

View source: R/dens_test.R

Description

Calls the DCdensity test from package rdd on a rdd_object.

Usage

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

Arguments

rdd_object

object of class rdd_data

bin

Argument of the DCdensity function, the binwidth

bw

Argument of the DCdensity function, the bandwidth

plot

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

...

Further arguments passed to DCdensity.

Examples

1
2
3
data(house)
house_rdd <- rdd_data(y=house$y, x=house$x, cutpoint=0)
dens_test(house_rdd)

Example output

Loading required package: AER
Loading required package: car
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: sandwich
Loading required package: survival
Loading required package: np
Nonparametric Kernel Methods for Mixed Datatypes (version 0.60-3)
[vignette("np_faq",package="np") provides answers to frequently asked questions]
[vignette("np",package="np") an overview]
[vignette("entropy_np",package="np") an overview of entropy-based methods]

	McCrary Test for no discontinuity of density around cutpoint

data:  house_rdd
z-val = 1.2952, p-value = 0.1952
alternative hypothesis: Density is discontinuous around cutpoint
sample estimates:
Discontinuity 
    0.1035008 

rddtools documentation built on Jan. 10, 2022, 5:07 p.m.