Skip to content

medflex

0.6-11Package record

Flexible Mediation Analysis Using Natural Effect Models

0packages depend
12.2Kdownloads / year
–test coverage
12/13flavors OK

Overview

About

Run flexible mediation analyses using natural effect models as described in Lange, Vansteelandt and Bekaert (2012) DOI:10.1093/aje/kwr525, Vansteelandt, Bekaert and Lange (2012) DOI:10.1515/2161-962X.1014 and Loeys, Moerkerke, De Smet, Buysse, Steen and Vansteelandt (2013) DOI:10.1080/00273171.2013.832132.

Changes in 0.6-11
  • Issue related to changes missing package anchors in the "Rd cross-references" check (in version 0.6-10) fixed

From NEWS in the release

Install

Health

CRAN checks
1ERROR12OK
Check messages
ERRORexamplesr-devel-linux-x86_64-debian-gcc
Running examples in ‘medflex-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: neImpute.default
> ### Title: Expand the dataset and impute nested counterfactual outcomes
> ### Aliases: neImpute.default
> 
> ### ** Examples
> 
> data(UPBdata)
> 
> ## example using glm imputation model with binary exposure
> fit.glm <- glm(UPB ~ factor(attbin) + negaff + gender + educ + age, 
+                family = binomial, data = UPBdata)
> impData <- neImpute(fit.glm)
> head(impData)
  id attbin0 attbin1        att attcat    negaff initiator gender educ age
1  1       1       1  1.0005617      M  0.840461    myself      F    M  41
2  1       0       1  1.0005617      M  0.840461    myself      F    M  41
3  2       0       0 -0.7085889      L -1.257465      both      M    M  42
4  2       1       0 -0.7085889      L -1.257465      both      M    M  42
5  3       0       0 -0.7085889      L -1.202256      both      F    H  43
6  3 
...[truncated]...
 1      M  0.840461    myself      F    M  41 0.5106796    1
2  1  low high      1      M  0.840461    myself      F    M  41 0.4059912    1
3  2  low  low      0      L -1.257465      both      M    M  42 0.1999050    0
4  2 high  low      0      L -1.257465      both      M    M  42 0.2761580    0
5  3  low  low      0      L -1.202256      both      F    H  43 0.1668007    0
6  3 high  low      0      L -1.202256      both      F    H  43 0.2341212    0
> 
> # test with gam?
> if (requireNamespace("gam", quietly = TRUE)) {
+ library(gam)
+ impFit4 <- gam(UPB ~ att + negaff + gender + educ + age, family = binomial, data = UPBdata)
+ impData4 <- neImpute(impFit4)
+ head(impData2); head(impData4)
+ # check!
+ }
Loading required package: foreach
Loaded gam 1.22-7


Attaching package: ‘gam’

The following object is masked from ‘package:VGAM’:

    s

Error in a$specials[[i]] : subscript out of bounds
Calls: neImpute ... predict.glm -> predict.lm -> delete.response -> off
Execution halted

CRAN check page ↗

Slowest check: 2.6 min · r-oldrel-windows-x86_64
Status changes
  • ERROR12 OK, 1 ERROR2026-10-24
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
Show 1 earlier changeHide 1 earlier change
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.6-11
README· In the repository, left out of the releaseVignettesYes · 2 · dynamicNEWSYes · 0% structured · mentions 0.6-11Citation fileYes · cites a publicationWebsitenot declared in DESCRIPTION
Cites a JSS article
Help pages
15
Examples that run
100%11 run in a plain check
Exported functions with examples
60%
Documented parameters
100%
Return-value docs
80%
Help pages citing references
27%

Downloads

12.2K
CRAN downloads in the past year
Rank #3,705 · ~33/day · ~1K/mo
Daily download trend is not available in this view yet.
96130 days
2.7K90 days
12.2K1 year
Compare downloads with other packages →
Also on133 r2u6 autocran681 conda_forge146 c2d4u

Repository

25Stars
7Forks
10Open issues
0Open PRs
0Releases
88Commits
3Commit identities
mediation-analysiscausal-inferenceflexible-modelingr-package
88 commits · Last activity 2023-06-22 · 0% stars, 30d · The default branch showed an older version (0.6-10) than CRAN on 2026-10-21
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
12
Median days to close, 50 most recently updated closed PRs
6

Stars over time

2025-10-12 · 252026-07-07 · 25
PracticesBeta

2 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/jmpsteen/medflex on 2026-10-21.

Continuous integration (1)
Travis CI (config file)
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
11 external dependencies (excludes base and recommended)

Installing medflex adds 64 packages (33 with compiled code, 66 MB of source tarballs). Heaviest: stringi 11 MB, TH.data 8.2 MB, ggplot2 6.0 MB.

Depends (2)
R >= 3.1.2multcomp
Imports (7)
bootcarMatrixgraphicssandwichstatsutils (>= 3.1.2)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (10)
Author, Maintainer since 0.4.0 (2014)
Author
Contributor · added in 0.6-6
Contributor
valuable suggestions
Contributor · added in 0.6-1
Contributor
technical support
Contributor · added in 0.6-10
Contributor · added in 0.6-10
Releases (10)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.6-11Latest
    record
    2025-10-13 · current release · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • unarchivedReturned to CRAN
    2023-06-22
  • 0.6-10
    record
    2023-06-22 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • archivedRemoved from CRAN
    2023-04-13
    issues were not corrected in time
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • unarchivedReturned to CRAN
    2020-08-03
  • 0.6-7
    record
    2020-08-03 · diff ↗
  • archivedRemoved from CRAN
    2020-05-01
    check issues were not corrected despite reminders
  • R
    R 4.0.0 released · 2020-04-24
  • R
    R 3.6.0 released · 2019-04-26
  • 0.6-6
    record
    2018-09-03 · diff ↗
Show 11 earlier eventsHide 11 earlier events
  • R
    R 3.5.0 released · 2018-04-23
  • 0.6-4
    record
    2017-09-15 · diff ↗
  • R
    R 3.4.0 released · 2017-04-21
  • 0.6-1
    record
    2017-02-22 · diff ↗
  • R
    R 3.3.0 released · 2016-05-03
  • 0.6-0
    record
    2015-09-13 · diff ↗
  • 0.5-1
    record
    2015-07-01 · diff ↗
  • R
    R 3.2.0 released · 2015-04-16
  • 0.5-0
    record
    2015-02-07 · diff ↗ ·
    added 1 export
    plot.neLht
  • 0.4.0
    record
    2014-12-11
  • R
    R 3.1.0 released · 2014-04-10

Package metadata

First published
2014-12-11
Total releases
10 / 12 yrs
License
GPL-2 OSI
Minimum R
≥ 3.1.2
Bundled data
4.6 KB / 1 file
Download size
626 KB

Cite

Cite this package

Run in R for the authors' entry:

citation("medflex")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.18637/jss.v076.i11, 10.1093/aje/kwr525, 10.1515/2161-962x.1014, 10.1080/00273171.2013.832132.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for medflex version 0.6-11 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy