rd_power: Power Analysis of Regression Discontinuity

View source: R/rd_power.R

rd_powerR Documentation

Power Analysis of Regression Discontinuity

Description

rd_power computes the empirical probability that a resulting parameter estimate of the MRD is significant, i.e. the empirical power (1 - beta).

Usage

rd_power(
  num.rep = 100,
  sample.size = 100,
  x.dist = "normal",
  x.para = c(0, 1),
  x.cut = 0,
  x.fuzzy = c(0, 0),
  x.design = NULL,
  coeff = c(0.3, 1, 0.2, 0.3),
  eta.sq = 0.5,
  alpha.list = c(0.001, 0.01, 0.05)
)

Arguments

num.rep

A non-negative integer specifying the number of repetitions used to calculate the empirical power. The default is 100.

sample.size

A non-negative integer specifying the number of observations in each sample. The default is 100.

x.dist

A string specifying the distribution of the assignment variable, x. Options are "normal" and "uniform". The default is the "normal" distribution.

x.para

A numeric vector of length 2 specifying parameters of the distribution of the first assignment variable, x1. If x.dist is "normal", then x.para includes the mean and standard deviation of the normal distribution. If x.dist is "uniform", then x.para includes the upper and lower boundaries of the uniform distribution. The default is c(0,1).

x.cut

A numeric value containing the cutpoint at which assignment to the treatment is determined. The default is 0.

x.fuzzy

A numeric vector of length 2 specifying the probabilities to be assigned to the control, in terms of the assignment variable, x, for individuals in the treatment based on the cutoff, and to treatment for individuals in the control based on the cutoff. For a sharp design, both entries are 0. For a fuzzy design, the first entry is the probability to be assigned to control for individuals above the cutpoint, and the second entry is the probability to be assigned to treatment for individuals below the cutpoint. The default is c(0,0), indicating a sharp design.

x.design

A string specifying the treatment option according to design. Options are "g" (treatment is assigned if x is greater than its cutoff), "geq" (treatment is assigned if x is greater than or equal to its cutoff), "l" (treatment is assigned if x is less than its cutoff), and "leq" (treatment is assigned if x is less than or equal to its cutoff).

coeff

A numeric vector specifying coefficients of variables in the linear model to generate data. Coefficients are in the following order:

  • The 1st entry is the intercept.

  • The 2nd entry is the slope of treatment, i.e. treatment effect.

  • The 3rd entry is the slope of assignment.

  • The 4th entry is the slope of interaction between treatment and assignment.

The default is c(0.3, 1, 0.2, 0.3).

eta.sq

A numeric value specifying the expected partial eta-squared of the linear model with respect to the treatment itself. It is used to control the variance of noise in the linear model. The default is 0.50.

alpha.list

A numeric vector containing significance levels (between 0 and 1) used to calculate the empirical alpha. The default is c(0.001, 0.01, 0.05).

Value

rd_power returns an object of class "rdp", including containing the mean, variance, and power (with alpha of 0.001, 0.01, and 0.05) for two estimators. The function summary is used to obtain and print a summary of the power analysis. The two estimators are:

  • The 1st estimator, Linear, provides results of the linear regression estimator.

  • The 2nd estimator, Opt, provides results of the local linear regression estimator of RD, with the optimal bandwidth in the Imbens and Kalyanaraman (2012) paper.

References

Imbens, G., Kalyanaraman, K. (2012). Optimal bandwidth choice for the regression discontinuity estimator. The Review of Economic Studies, 79(3), 933-959. https://academic.oup.com/restud/article/79/3/933/1533189.

Examples

## Not run: 
summary(rd_power(x.design = "l"))
summary(rd_power(x.dist = "uniform", x.cut = 0.5, x.design = "l"))
summary(rd_power(x.fuzzy = c(0.1, 0.1), x.design = "l"))

## End(Not run)

rddapp documentation built on April 6, 2023, 1:15 a.m.