Companion Datasets and Functions for Research Design in the Social Sciences

Helper functions to accompany the Blair, Coppock, and Humphreys (2023) "Research Design in the Social Sciences: Declaration, Diagnosis, and Redesign" < https://book.declaredesign.org>. 'rdss' includes datasets, helper functions, and plotting components to enable use and replication of the book.


rdss: Companion Datasets and Functions for Research Design in the Social Sciences

CRANstatus CRAN RStudio mirrordownloads Buildstatus Codecov testcoverage

Datasets and helper functions for the book Research Design in the Social Sciences: Declaration, Diagnosis, and Redesign by Graeme Blair, Alexander Coppock, and Macartan Humphreys (Princeton University Press, 2023). The package website has a Get started article that lists which helpers each section of the book uses.

Installation

Install the released version from CRAN:

install.packages("rdss")

or the development version from GitHub:

remotes::install_github("DeclareDesign/rdss")

estimator_AS_tidy(), used in the book’s section on experiments over networks, needs the ‘interference’ package, which is not on CRAN. It works only in the GitHub version of rdss, so install both from GitHub:

remotes::install_github("szonszein/interference")
remotes::install_github("DeclareDesign/rdss")

did_multiplegt_tidy(), used in the book’s section on difference-in-differences, needs the ‘polars’ package, which is also not on CRAN:

install.packages("polars", repos = "https://rpolars.r-universe.dev")

Example

Each helper fills one step of a declaration in the book, and its help page links to the section that uses it. lag_by_group(), for instance, builds the lagged treatment indicator in the difference-in-differences design:

library(rdss)
library(dplyr)

panel <-
  tibble(
    unit = rep(c("a", "b"), each = 3),
    period = rep(1:3, times = 2),
    D = c(0, 1, 1, 0, 0, 1)
  ) |>
  mutate(D_lag = lag_by_group(D, groups = unit, n = 1, order_by = period))

panel
## # A tibble: 6 × 4
##   unit  period     D D_lag
##   <chr>  <int> <dbl> <dbl>
## 1 a          1     0    NA
## 2 a          2     1     0
## 3 a          3     1     1
## 4 b          1     0    NA
## 5 b          2     0     0
## 6 b          3     1     0

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("rdss")

1.0.16 by Alexander Coppock, 6 days ago


https://declaredesign.org/r/rdss/, https://github.com/DeclareDesign/rdss


Report a bug at https://github.com/DeclareDesign/rdss/issues


Browse source code at https://github.com/cran/rdss


Authors: Graeme Blair [aut] , Alexander Coppock [aut, cre] (ORCID: , Macartan Humphreys [aut] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, rlang, generics, ggplot2, tibble, tidyr, dataverse, readr, broom, purrr, estimatr, randomizr

Suggests testthat, rdrobust, DIDmultiplegt, broom.mixed, marginaleffects, grf, CausalQueries, metafor, cjoint, lme4, rstanarm, spdep, DeclareDesign, curl, polars


See at CRAN