-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathREADME.Rmd
More file actions
73 lines (53 loc) · 1.7 KB
/
README.Rmd
File metadata and controls
73 lines (53 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
ri2 makes conducting randomization inference easy and (with the blessing of the original authors) is the successor package to [ri](https://cran.r-project.org/web/packages/ri/index.html).
ri2 has specific support for the following:
1. All randomization schemes in [randomizr](http://randomizr.declaredesign.org).
2. Difference-in-means and OLS-adjusted estimates of ATE estimates using R-native formula syntax.
3. Multi-arm trials.
4. ANOVA-style hypothesis tests (e.g., testing interaction term under null of constant effects),
Additionally, ri2 provides:
1. Accommodation for arbitrary randomization schemes
2. Accommodation for arbitrary (scalar) test statistics
You can install ri2 is on CRAN
```{r, eval=FALSE}
install.packages("ri2")
```
If you'd like to install the most current development release, you can use the following code:
```{r,eval=FALSE}
install.packages("devtools")
devtools::install_github("acoppock/ri2")
```
Here is the basic syntax for a two-arm trial:
```{r}
library(ri2)
N <- 100
declaration <- declare_ra(N = N, m = 50)
Z <- conduct_ra(declaration)
X <- rnorm(N)
Y <- .9 * X + .2 * Z + rnorm(N)
dat <- data.frame(Y, X, Z)
ri_out <-
conduct_ri(
formula = Y ~ Z,
declaration = declaration,
assignment = "Z",
sharp_hypothesis = 0,
data = dat
)
plot(ri_out)
summary(ri_out)
```
The development of ri2 is supported by a Standards Grant from [EGAP](http://egap.org).
```{r, out.height = "50px", echo=FALSE}
knitr::include_graphics("man/figures/EGAP_logo.jpg")
```