
Compute weight allowance from interval in months (vectorized)
Source:R/adult_support.R
compute_wtallow.RdBuilt-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.
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.)