models.clinical.phenoage
models.clinical.phenoage(df, crp_transform='log', coefficients='levine2018')Clinical Phenotypic Age in years.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| df | pd.DataFrame | One row per sample, columns named as in :data:PHENOAGE_UNITS, already converted to those units. :func:falconage.preprocess.clinical.prepare does the conversion; calling this directly means asserting it is done. |
required |
Notes
CRP enters as log(crp) with crp in mg/dL, which is the one place the paper departs from SI and the single most common transcription error in reimplementations – a factor of ten in CRP moves PhenoAge by about 0.22 years per log unit, small enough to look plausible and large enough to matter across a cohort.
crp_transform="log1p" uses log(1 + crp), BioAge’s lncrp. It is not the paper’s transform: on NHANES III it raises PhenoAge by a mean 1.57 years (SD 0.45, n = 8,924), more at low CRP, because ln(1 + CRP) - ln(CRP) = ln(1 + 1/CRP). Use it only to compare with BioAge output.
coefficients="levine2018" applies Table 1 of the paper as printed. "bioage" applies :data:PHENOAGE_BIOAGE, the same fit at full precision. With both BioAge options the result is BioAge’s phenoage0: on its 8,924 NHANES III rows the largest difference is below 0.00001 years.