# inspect: Computes Regression Discontinuity Design Effects In metinbulus/cosa: Bound Constrained Optimal Sample Size Allocation

## Description

Computes Regression Discontinuity Design Effects (RDDE) either based on analytic deviations (up to second order with interactions), an empirical score variable, or simulation.

## Usage

 ```1 2 3 4``` ``` inspect.score(score = NULL, p = NULL, cutoff = NULL, treat.lower = FALSE, order = 1, interaction = FALSE, mu = 0, sigma = 1, k1 = -Inf, k2 = Inf, dists = "normal", sim = FALSE, ndraw = 1000, nsim = 1000) ```

## Arguments

 `sim` logical; if `TRUE` results are based on simulation. `score` vector; score variable. `p` proportion of units in the treatment condition. `cutoff` decision threshold. `treat.lower` logical; if `TRUE` units below cutoff are treated. `order` integer >= 0; order of polynomial functional form specification for the score variable. `interaction` logical; if `TRUE` polynomial specification interacts with the treatment variable. `mu` mean of (uncentered) truncated normal - applies when `score = NULL` and `dists = "normal"`. `sigma` standard deviation of (uncentered) truncated normal - applies when `score = NULL` and `dists = "normal"`. `k1` left truncation point for (uncentered) empirical, truncated normal, or uniform distribution. `k2` right truncation point for (uncentered) empirical, truncated normal, or uniform distribution. `dists` char; type of distribution, `"normal"` or `"uniform"`. `ndraw` number of draws - applies when `sim = TRUE`. `nsim` number of simulations - applies when `sim = TRUE`.

## Value

 `parms` list; list of parameters used in the computation. `cutoff` decision threshold (computed if `p` is provided). `treat.lower` if `TRUE` units below cutoff are treated. `p` proportion of subjects treated (computed if `cutoff` is provided). `order` order of polynomial specification for the score variable. `interaction` if `TRUE` polynomial specification interacts with the treatment variable. `center` if `TRUE` the score variable is centered on the cutoff `rdde` regression discontinuity design effect.

## Examples

 ```1 2 3 4 5 6``` ``` # based on an empirical score variable inspect.score(score = rnorm(10000), cutoff = 0) # based on analytic derivation inspect.score(cutoff = 0) # based on simulation inspect.score(sim = TRUE, cutoff = 0) ```

metinbulus/cosa documentation built on Sept. 9, 2021, 12:04 p.m.