Estimation, Diagnostics and Visualization of Conditional Marginal Effects
Overview
Performs estimation, diagnostics, and visualization of conditional marginal effects and group average treatment effects of a treatment on an outcome across different values of a moderator. Optionally integrates with the 'mlr3extralearners' package for additional machine learning backends compatible with the double machine learning estimators. 'mlr3extralearners' is not on CRAN but can be obtained from https://github.com/mlr-org/mlr3extralearners.
1. Fixed the kernel estimator's adaptive bandwidth: the normalizer is now the geometric mean of the moderator's density at the observations (Abramson's rule) instead of over the whole density grid, fixing "subscript out of bounds" and "$ operator is invalid" errors on moderators with gaps or long tails.
2. With a fixed bw, kernel windows are now wider than in 1.4.0 (typically 1.5-3x on well-behaved moderators); results under the default cross-validated bw change little.
3. Kernel local fits that are unidentified, fail, or have no usable kernel weights are now dropped with a warning, or the call stops with a clear "Inappropriate bandwidth" error, instead of being filled with zeros or crashing; cross-validation can no longer silently return bw = -Inf; an invalid bw is now rejected with an error.
4. interflex() no longer sets the global option interflex.uniform_ci_warned.
5. inter.test() now documents its return value.
6. interflex() gains bw.select, bw.se.mult and bw.ess.min, which expose the bandwidth selection rules of the kernel estimator ("cv.min", the default; "cv.1se"; "cv.1se.ess"; "ess") and pass them, together with bw, through to the kernel smoothing step of the lasso estimator with a continuous treatment. Use bw.select = "cv.1se" when cross-validation cannot separate the candidate bandwidths.
7. citation("interflex") now lists the methods paper (Hainmueller, Mummolo and Xu 2019), the practical guide to the modern estimators (Liu, Liu and Xu, arXiv:2504.01355, forthcoming as a Cambridge Element), and the package.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK12 OK2026-04-25
Show 2 earlier changesHide 2 earlier changes
- NOTE12 OK, 2 NOTE2026-04-11
- OK14 OK2026-03-10
Documentation
- Help pages
- 16 (11 internal)includes a package overview page
- Examples that run
- 100%1 run in a plain check
- Exported functions with examples
- 50%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 38%
Downloads
Repository
- PRs merged (all time)
- 88%
- Median days to close, 50 most recently updated closed issues
- 144
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
4 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/xuyiqing/interflex on 2026-10-18.
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-03-15Named in .gitignore: .claudePull request it wrote: opened by a project memberCommits: 23 by its own account · at least 22 crediting it in the message
- Claude Opus 4.610 commits · Mar to Apr 2026
- Claude Fable 5.18 commits · Sep 2026
- Claude Opus 4.72 commits · Apr 2026
- Claude Sonnet 52 commits · Sep 2026
Dependencies
Installing interflex adds 116 packages (57 with compiled code, 96 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.
Code & Tests
Datasets
People & History
Previously maintained by Ziyi Liu (1.2.5 to 1.2.6) and Yiqing Xu (1.0.2 to 1.1.3).
Pick two releases to compare their code metrics.
- 1.4.1Latest
- RR 4.6.0 released · 2026-04-24
- 1.4.0
- 1.2.82025-12-17 · diff ↗
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- 1.2.62021-05-18 · diff ↗
- RR 4.1.0 released · 2021-05-18
- unarchivedReturned to CRAN2021-05-06
- 1.2.52021-05-06 · diff ↗ ·
removed 6 exports
inter.test, inter.raw, inter.gam, inter.linear, inter.binning, inter.kernel - archivedRemoved from CRAN2020-12-04requires archived package 'lfe'
- RR 4.0.0 released · 2020-04-24
- 1.1.3
- 1.0.8
Package metadata
- First published
- 2017-02-27
- Total releases
- 10 / 9 yrs
- License
- MIT + file LICENSE OSI · relicensed from GPL-2 in 1.0.8
- Additional repositories
- mlr-org.r-universe.dev
- Minimum R
- ≥ 3.5.0
- Bundled data
- 179 KB / 1 file
- Download size
- 338 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("interflex")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.