rd_power | R Documentation |

`rd_power`

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

```
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)
)
```

`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.para` |
A numeric vector of length 2 specifying parameters of the distribution of the first assignment variable, |

`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.design` |
A string specifying the treatment option according to design.
Options are |

`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 |

`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 |

`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.

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.

```
## 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)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.