Changelog
Source:NEWS.md
psAve 1.0.1
- Learner engines now run single-threaded by default (
rangernum.threads = 1,xgboostnthread = 1), in line with CRAN’s at-most-2-cores policy; raise viacontrolfor real analyses (fixes the CRAN incoming pre-test NOTE “Re-building vignettes had CPU time 7.7 times elapsed time”). Selection results are unchanged.
psAve 1.0.0
Initial release, implementing Kabata, Stuart & Shintani (2024), BMC Medical Research Methodology 24:228, doi:10.1186/s12874-024-02350-y.
-
psave(): model-averaged propensity scores as a convex combination of candidate models ("glm","rpart","ranger","xgboost"by default; any"SL.*"SuperLearner wrapper; or user-suppliedps.matrix/prog.matrix), with mixing weights selected on a simplex grid. -
ps.append/prog.append: extra user-supplied candidate score columns (a vector of length n, or a matrix/all-numeric data frame with unique column names) appended AFTER the candidates fromps.methods/ps.matrixandprog.methods/prog.matrix. Appended propensity columns are validated (strictly in (0, 1)) and clipped like every other candidate; grid tie-breaking favors the base candidates. Supplyingprog.matrixorprog.appendwithoutoutcomeis an explicit error (prognostic candidates require the outcome; gamma is selected by outcome-prediction MSE among untreated units). - Four selection criteria from the paper:
"prog"(weighted ASMD of the model-averaged prognostic score, the recommended default; per-candidate targets viaprog.target),"smd","ks", and"logloss". Estimands: ATT (default) and ATE, with the supplement’s estimand-specific weight formulas. - Prognostic scores per Hansen (2008): candidate outcome models fit on untreated units only; mixing weights
gammaselected by unweighted untreated-set MSE.gaussian()andbinomial()outcome families. -
average = FALSEvertex mode selects the single best candidate propensity score by the chosen criterion. - Ecosystem integration:
fit$psdrops intoMatchIt::matchit(distance = )andWeightIt::weightit(ps = );psave_match()/psave_weight()wrappers reuse the stored formula and data to eliminate row-misalignment;cobalt::bal.tab()works directly onpsaveobjects. - Full S3 suite:
print()(with the literal next call),summary()(mixing weights, all-criteria diagnostics table, full balance table),plot()("balance","distribution","criterion"),fitted(),weights(),predict()(withkeep.fits = TRUE). - Exported utilities:
simplex_grid()(integer-composition simplex enumeration defining the tie-breaking order) andpsave_criteria()(all four criteria for any propensity score vector). - Documented fixes relative to the paper’s reference code: integer-arithmetic simplex grid (the reference’s floating-point
rowSums == 1filter silently dropped ~10.6% of grid points); proper weighted-eCDF KS statistic;binomial()family for binary responses; no train/test-inconsistentscale(); strict complete-case handling (NAs error, never dropped). Seevignette("method-details", package = "psAve"). - Three vignettes: Getting Started (matching workflow), Reproducing the published IPW workflow (ATT/ATE weighting with
survey::svyglm()), and Method details.