Crandore Hub

eff2

Efficient Least Squares for Total Causal Effects

Estimate a total causal effect from observational data under linearity and causal sufficiency. The observational data is supposed to be generated from a linear structural equation model (SEM) with independent and additive noise. The underlying causal DAG associated the SEM is required to be known up to a maximally oriented partially directed graph (MPDAG), which is a general class of graphs consisting of both directed and undirected edges, including CPDAGs (i.e., essential graphs) and DAGs. Such graphs are usually obtained with structure learning algorithms with added background knowledge. The program is able to estimate every identified effect, including single and multiple treatment variables. Moreover, the resulting estimate has the minimal asymptotic covariance (and hence shortest confidence intervals) among all estimators that are based on the sample covariance.

README

# eff² <img src="docs/eff2-logo.png" align="right" width="165px"/>
**Efficient Least Squares for Estimating Total Causal Effects**

`eff2` is an `R` package for estimating a total causal effect from observational data under linearity and causal sufficiency (no unobserved confounding, no selection bias). It can consistently estimate any identified effect, including single and multiple treatment variables. Moreover, the resulting estimate has the minimal asymptotic covariance (and hence shortest confidence intervals) among all estimators that are based on the sample second moment.

## Installation

From [CRAN](https://cran.r-project.org/package=eff2):

```R
install.packages("eff2")
```

Alternatively, the package can be installed from GitHub.

``` r
# install.packages("devtools")
# install.packages("rmarkdown")
# install.packages("qgraph")
devtools::install_github("richardkwo/eff2", build_vignettes = TRUE)
```

In case of problem, first make sure dependency [pcalg](https://cran.r-project.org/package=pcalg) is properly installed. Several packages required by `pcalg` are removed from CRAN and have to be installed from BioConductor:

```R
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("graph")
BiocManager::install("RBGL")
```

For a quick start, check out the vignette:

```R
vignette("eff2-doc")
```

## Reference

Guo, F. Richard, and Emilija Perković. "Efficient Least Squares for Estimating Total Effects under Linearity and Causal Sufficiency." *[arXiv preprint arXiv:2008.03481](https://arxiv.org/abs/2008.03481)* (2020).

Versions across snapshots

VersionRepositoryFileSize
1.0.2 rolling linux/jammy R-4.5 eff2_1.0.2.tar.gz 168.1 KiB
1.0.2 rolling linux/noble R-4.5 eff2_1.0.2.tar.gz 168.1 KiB
1.0.2 rolling source/ R- eff2_1.0.2.tar.gz 168.1 KiB
1.0.2 latest linux/jammy R-4.5 eff2_1.0.2.tar.gz 168.1 KiB
1.0.2 latest linux/noble R-4.5 eff2_1.0.2.tar.gz 168.1 KiB
1.0.2 latest source/ R- eff2_1.0.2.tar.gz 168.1 KiB
1.0.2 2026-04-26 source/ R- eff2_1.0.2.tar.gz 168.1 KiB
1.0.2 2026-04-23 source/ R- eff2_1.0.2.tar.gz 168.1 KiB
1.0.2 2025-04-20 source/ R- eff2_1.0.2.tar.gz 168.1 KiB

Dependencies (latest)

Imports

Suggests