Skip to content

2.1.0

Choose a tag to compare

@QuentinAndre QuentinAndre released this 25 Sep 23:42
· 27 commits to master since this release

Additive release, tracked in the
2.1.0 milestone.
Nothing written against 2.0 stops working.

Added

  • Process.tidy(): every estimate in one long DataFrame with fixed column names (component, outcome, term, moderator, one column per moderator, estimate, std_error, statistic, p_value, conf_low, conf_high, method, conf_level, n_boot), modelled on R's broom (#64).
  • Process.glance(): one row of fit statistics per outcome model, including log-likelihood, AIC and BIC, which are also stored in estimation_results (#65).
  • Process.augment(): the analysis data with fitted values and residuals per outcome model (#66).
  • Process.summary() returns the text it prints, str(process) gives the same text, and a Process object displays its tables as HTML in notebooks (#71).
  • README section on tidy(), glance(), augment() and the summary() text.
  • OutcomeModel.to_statsmodels() and Process.to_statsmodels() refit each outcome model with statsmodels (same design matrix, same covariance estimator) and return the statsmodels results object, giving access to its summaries, contrasts, diagnostics and table formatters. statsmodels is an optional extra: pip install pyprocessmacro[statsmodels] (#67).
  • Model 6, serial mediation with two to four mediators in causal order: specific indirect effects through every ordered subset of mediators, labelled by path, plus total and contrasts. Point estimates are checked against products of statsmodels coefficients and the bootstrap against an independent resampler; a PROCESS 2.16 output file for model 6 is not part of the fixtures yet (#69).
  • effsize=True reports the partially and completely standardized indirect effects with bootstrap intervals, standardized within each resample as PROCESS does, for unmoderated indirect paths with a continuous outcome (models 4 and 6). The option used to warn that it was unsupported (#70).

Changed

  • The printed tables are assembled from typed columns instead of a string array coerced back to numbers; same content, no more to_numeric round trip (#72).
  • The bootstrap fits resamples in batches with stacked linear algebra instead of one Python iteration per resample, which makes mediation models several times faster. The resample indices are drawn exactly as before, so a given seed still reproduces the same draws and, up to floating-point rounding, the same estimates as 2.0 (#68, resolves #75 for this release).

Fixed

  • A perfectly separated logistic regression raises ConvergenceError on every platform. On numpy 1.26 the Newton-Raphson loop could reach a saturated fit, where the score is exactly zero, and return huge coefficients as if it had converged.