← Back to all sparks
R

rmediation

ANALYTICS
Velocity3.8

R package rmediation by Data-Wise — release notes from GitHub.

RMediation shipped a three-normal CDF, then found it was silently wrong.

mediation analysisnumerical integrationcorrectnesss7 classescranr package
Current state
RMediation is a long-standing CRAN package for confidence intervals on mediated effects, now built on an S7 class hierarchy. Over eight weeks it added ProductNormal3 for serial indirect effects of the form a1*a2*b, folded the engine into the existing pprodnormal naming family, and then replaced that engine outright after finding it returned wrong probabilities without warning. The dev branch is at 1.7.0; CRAN still serves 1.6.1.
Where it's heading
The package is moving from a hand-rolled numerical layer to one that checks itself: the new default integrator escalates its node count until successive rules agree, warns when it hits the cap instead of returning a number, and exposes a diagnostics argument for the convergence estimate. The correctness fix went to dev ahead of the CRAN window rather than being held for it, which suggests wrong-answer bugs are treated as release-blocking regardless of cadence. Serial mediation is where the new surface area is concentrated.
Prediction
1.7.0 exists specifically to land before CRAN's 2026-08-21 update window, so the next move is a CRAN submission promoting it to main; whether hcubature survives past that as a cross-check option is the open question.

Recent moves

  1. 7h ago

    v1.7.0 — pprodnormal3() correctness fix

    ⚡ SPARK

    Replaces the integrator behind pprodnormal3() after discovering it converged to stable but wrong values on ill-conditioned covariance — 92% relative error at one tabulated point, and exactly 0 where the true probability was about 0.46. Everything that inverts this CDF — cdf(), confint(), ci(), dist_quantile() — inherited the error, making this the correctness event for the class introduced in 1.6.0.

    View source ↗
  2. 1mo ago

    p_prod3() renamed into the pprodnormal family

    Naming and documentation cleanup: p_prod3() becomes pprodnormal3() with a silent forwarding alias, the ci() generic's dispatch argument is renamed from mu to object for consistency with the other S7 generics, and undocumented internal helpers leave the documentation index. Only callers using ci(mu=) as a named argument are affected.

    View source ↗
  3. 1mo ago

    ProductNormal3: exact CDF for a product of three normals

    ⚡ SPARK

    Adds the ProductNormal3 S7 class and the engine behind it, extending the package from two-variable products to serial indirect effects of the form a1*a2*b. This is the capability 1.7.0 then had to repair.

    View source ↗
  4. 1mo ago

    medfit reaches CRAN; Remotes pointer dropped

    Drops the Remotes: pointer now that medfit is on CRAN, letting CRAN resolve the dependency from its own servers, and carries named-parameter covariance extraction with full off-diagonal support over from dev. The serial mediation path through medfit is now covered by integration tests end to end.

    View source ↗