{"id":51428192,"url":"https://github.com/heidihelena/recoverlite-py","last_synced_at":"2026-07-05T02:30:33.147Z","repository":{"id":369294378,"uuid":"1289215242","full_name":"heidihelena/recoverlite-py","owner":"heidihelena","description":"Python mirror of recoverlite: pre-data recovery tests for planned study designs (protocol-identical to the R package; results agree within Monte Carlo error)","archived":false,"fork":false,"pushed_at":"2026-07-04T13:56:57.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-04T15:20:34.770Z","etag":null,"topics":["estimands","metascience","monte-carlo","power-analysis","preregistration","python","research-methods","simulation","statistics","study-design"],"latest_commit_sha":null,"homepage":"https://github.com/heidihelena/recoverlite","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heidihelena.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-04T13:15:28.000Z","updated_at":"2026-07-04T13:37:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/heidihelena/recoverlite-py","commit_stats":null,"previous_names":["heidihelena/recoverlite-py"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/heidihelena/recoverlite-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heidihelena%2Frecoverlite-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heidihelena%2Frecoverlite-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heidihelena%2Frecoverlite-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heidihelena%2Frecoverlite-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heidihelena","download_url":"https://codeload.github.com/heidihelena/recoverlite-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heidihelena%2Frecoverlite-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35141966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["estimands","metascience","monte-carlo","power-analysis","preregistration","python","research-methods","simulation","statistics","study-design"],"created_at":"2026-07-05T02:30:32.465Z","updated_at":"2026-07-05T02:30:33.116Z","avatar_url":"https://github.com/heidihelena.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# recoverlite (Python)\n\n[![CI](https://github.com/heidihelena/recoverlite-py/actions/workflows/ci.yaml/badge.svg)](https://github.com/heidihelena/recoverlite-py/actions/workflows/ci.yaml)\n[![PyPI](https://img.shields.io/pypi/v/recoverlite.svg)](https://pypi.org/project/recoverlite/)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.21195922.svg)](https://doi.org/10.5281/zenodo.21195922)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n\n**Pre-data recovery tests for planned study designs** — the Python\nmirror of the [R package](https://github.com/heidihelena/recoverlite).\n\nA planned study can be unable to support its intended inferential claim\neven when the researcher's substantive assumptions are correct.\n`recoverlite` simulates a *declared* design–analysis pair over a crossed\nscenario grid — null and target effects, each under declared and\npessimistically perturbed nuisance assumptions — and converts the\ndiagnosands into a **PASS / RISK / FAIL** verdict under a pre-specified,\nversioned threshold profile.\n\n## Mirror contract\n\nThis package is **protocol-identical** to the R implementation: same\ndeclaration API, same scenario grid, same diagnosands (including the\nexact decomposition *target bias = estimator bias + estimand drift*),\nsame threshold profiles (shared version string\n`recoverlite-thresholds-0.2`), same verdict rule, same report structure.\nSimulated numbers agree **within Monte Carlo error, not byte-identically**\n— R and Python cannot share RNG streams. The test suite enforces the\ncontract by reproducing the R package's archived worked-example\ndiagnosands within 4× combined MCSE.\n\n| | R package | Python mirror |\n|---|---|---|\n| Two-arm trial (baseline, additive measurement error, MAR/MCAR attrition, noncompliance) | ✅ | ✅ |\n| Complete-case linear model | ✅ | ✅ |\n| MI baseline-adjusted estimator (Rubin + Barnard-Rubin) | ✅ | ✅ |\n| Cluster trial, LMM (Wald-z / Satterthwaite / Kenward–Roger) | ✅ lme4 + lmerTest + pbkrtest | ✅ internal exact REML fitter |\n| Cluster-level t-test | ✅ | ✅ |\n| Fragility curves (effect + nuisance) | ✅ | ✅ |\n\nThe mixed-model machinery is self-contained (numpy/scipy only — no\nstatsmodels): a closed-form REML fitter for the random-intercept model\nwith Satterthwaite df (observed REML Hessian, the lmerTest algorithm)\nand Kenward–Roger adjusted covariance + df (expected REML information,\nthe pbkrtest algorithm). Because these methods are deterministic given\ndata, they are validated against lmerTest/pbkrtest **to numerical\nprecision** (rel. ≤ 1e-4) on shared fixture datasets — balanced,\nunbalanced, near-boundary, and null — in\n[`tests/data/`](tests/data/), a stronger contract than the MCSE-level\nsimulation cross-checks.\n\n## Install\n\n```bash\npip install recoverlite            # numpy + scipy only\n```\n\nNot yet on PyPI? Install from source:\n`pip install git+https://github.com/heidihelena/recoverlite-py`.\n\n## The workflow in one block\n\n```python\nimport recoverlite as rl\n\ndesign = rl.declare_recovery(\n    target=rl.target_estimand(\n        estimand=\"ITT mean difference at 12 weeks\",\n        scale=\"latent-outcome standardized mean difference\",\n        sesoi=0.40,\n    ),\n    data_strategy=rl.two_arm_trial(n_per_arm=115),\n    measurement=rl.measured_outcome(reliability=0.70),\n    missingness=rl.attrition_model(rate=0.15, mechanism=\"differential\"),\n    answer_strategy=rl.planned_analysis(\n        estimator=\"linear_model\",\n        formula=\"y_observed ~ treatment\",\n    ),\n)\n\nresult = rl.recovery_test(design, sims=2000,\n                          scenarios=\"confirmatory_grid\", seed=1)\nprint(rl.verdict(result))   # PASS / RISK / FAIL (+ strict/lenient recompute)\nrl.report(result)           # the standalone report always travels with it\n```\n\nCluster designs use `cluster_trial()` with\n`planned_analysis(\"lmm_random_intercept\", \"y_observed ~ treatment + (1 | cluster)\")`\n(Wald-z) or `\"cluster_mean_ttest\"`. Fragility curves —\n`effect_fragility()`, `nuisance_fragility()` — are deliberately outside\nthe verdict.\n\n## Citation\n\n\u003e Andersen, H. H. (2026). *Recovery before data: pre-data simulation\n\u003e diagnosis of planned study designs.* Working paper; preprint\n\u003e forthcoming. https://github.com/heidihelena/recoverlite\n\nA PASS is evidence about the instrument, not about the world.\n\n## License\n\n[Apache License 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheidihelena%2Frecoverlite-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheidihelena%2Frecoverlite-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheidihelena%2Frecoverlite-py/lists"}