Skip to contents

Built-in formulas: "piecewise" (PW-H, default), "piecewise-lower" (PW-L), "allofus15". Custom: pass a file path to a CSV with columns 'months' and 'wtallow'. Values are linearly interpolated; months beyond the table are clamped to the nearest row.

Usage

compute_wtallow(months, formula = "piecewise", uw = NULL)

Arguments

months

Numeric vector of interval lengths in months

formula

Character: formula name or path to custom CSV

uw

Optional numeric vector of upper weights (higher of two adjacent weights, or max(wt, ewma)). NULL = use base (UW=120) formula.

Value

Numeric vector of weight allowances

Details

UW (upper weight) scaling:

  • PW-H: scaled up for UW > 120 (slope 0.25/kg, UW capped at 180) and down for UW < 120, with 2/3 ceiling.

  • PW-L: NOT scaled up for UW > 120. Scaled down for UW < 120, with 2/3 ceiling.

  • allofus15: not adjusted by UW, except its 12m cap is limited to never exceed the effective PW-L at 12m for that UW.

  • Custom CSV: no UW adjustment.

References

Guide A, Sulieman L, Garbett S, Cronin RM, Spotnitz M, Natarajan K, Carroll RJ, Harris P, Chen Q. Identifying erroneous height and weight values from adult electronic health records in the All of Us research program. J Biomed Inform. 2024 Jul;155:104660. doi:10.1016/j.jbi.2024.104660 . (Source of the adapted "allofus15" formula.)