DiSCos
Distributional Synthetic Controls Estimation
Description
The method of synthetic controls is a widely-adopted tool for evaluating causal effects of policy changes in settings with observational data. In many settings where it is applicable, researchers want to identify causal effects of policy changes on a treated unit at an aggregate level while having access to data at a finer granularity. This package implements a simple extension of the synthetic controls estimator, developed in Gunsilius (2023) <doi:10.3982/ECTA18260>, that takes advantage of this additional structure and provides nonparametric estimates of the heterogeneity within the aggregate unit. The idea is to replicate the quantile function associated with the treated unit by a weighted average of quantile functions of the control units. The package contains tools for aggregating and plotting the resulting distributional estimates, as well as for carrying out inference on them.
Downloads
1.3K
Last 30 days
3376th
1.7K
Last 90 days
3.6K
Last year
Trend: +242.7% (30d vs prior 30d)
CRAN Check Status
Show all 14 flavors
| Flavor | Status |
|---|---|
| r-devel-linux-x86_64-debian-clang | OK |
| r-devel-linux-x86_64-debian-gcc | OK |
| r-devel-linux-x86_64-fedora-clang | OK |
| r-devel-linux-x86_64-fedora-gcc | OK |
| r-devel-macos-arm64 | OK |
| r-devel-windows-x86_64 | OK |
| r-oldrel-macos-arm64 | OK |
| r-oldrel-macos-x86_64 | OK |
| r-oldrel-windows-x86_64 | OK |
| r-patched-linux-x86_64 | ERROR |
| r-release-linux-x86_64 | OK |
| r-release-macos-arm64 | OK |
| r-release-macos-x86_64 | OK |
| r-release-windows-x86_64 | OK |
Check details (1 non-OK)
tests
Running ‘testthat.R’ [165s/204s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(DiSCos)
Loading required package: data.table
Attaching package: 'data.table'
The following object is masked from 'package:base':
%notin%
Loading required package: ggplot2
>
> options(datatable.auto.thread = 1) # Limit data.table to 1 thread
> Sys.setenv(OMP_NUM_THREADS = 1) # limit environment to 1 thread
>
> test_check("DiSCos")
Saving _problems/test-DiSCo-13.R
Warning: in parln3(lmom, ...): L-skew is negative, try reversing the data Y <- -X, to avoid
...[truncated]...
3 *
---
Signif. codes: `*' Confidence band for distribution differences does not cover 0
No permutation test performed.
Number of pre-treatment periods: 1
Number of post-treatment periods: 1
N=10,000
[ FAIL 1 | WARN 35 | SKIP 0 | PASS 113 ]
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-DiSCo.R:13:3'): mixture weights sum up to 1 ────────────────────
Error in `quantile.default(x, probs = (1 - cl)/2)`: missing values and NaN's not allowed if 'na.rm' is FALSE
Backtrace:
▆
1. └─DiSCos::DiSCo(...) at test-DiSCo.R:13:3
2. └─DiSCos:::parseBoots(...)
3. └─DiSCos (local) getCIs(q_boot, cl, q_d, uniform)
4. └─base::apply(...)
5. └─DiSCos (local) FUN(newX[, i], ...)
6. ├─stats::quantile(x, probs = (1 - cl)/2)
7. └─stats:::quantile.default(x, probs = (1 - cl)/2)
[ FAIL 1 | WARN 35 | SKIP 0 | PASS 113 ]
Error:
! Test failures.
Execution halted
Check History
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 2, 2026
tests
Running ‘testthat.R’ [165s/204s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additiona ...[truncated]... DiSCos (local) FUN(newX[, i], ...) 6. ├─stats::quantile(x, probs = (1 - cl)/2) 7. └─stats:::quantile.default(x, probs = (1 - cl)/2) [ FAIL 1 | WARN 35 | SKIP 0 | PASS 113 ] Error: ! Test failures. Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 24, 2026
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 21, 2026
tests
Running 'testthat.R' [200s] Running the tests in 'tests/testthat.R' failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional tes ...[truncated]... DiSCos (local) FUN(newX[, i], ...) 6. ├─stats::quantile(x, probs = (1 - cl)/2) 7. └─stats:::quantile.default(x, probs = (1 - cl)/2) [ FAIL 1 | WARN 34 | SKIP 0 | PASS 113 ] Error: ! Test failures. Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 20, 2026
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 19, 2026
tests
Running ‘testthat.R’ [103s/135s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additiona ...[truncated]... DiSCos (local) FUN(newX[, i], ...) 6. ├─stats::quantile(x, probs = (1 - cl)/2) 7. └─stats:::quantile.default(x, probs = (1 - cl)/2) [ FAIL 1 | WARN 35 | SKIP 0 | PASS 113 ] Error: ! Test failures. Execution halted
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 14, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 2 ERROR · 0 FAILURE Mar 10, 2026
dependencies in R code
Missing or unexported object: ‘CVXR::solve’
dependencies in R code
Missing or unexported object: 'CVXR::solve'