phenoage_calc: phenoage_calc

phenoage_calcR Documentation

phenoage_calc

Description

Project Phenotypic Age algorithm onto new data.

Usage

phenoage_calc(data, biomarkers, fit = NULL, orig = FALSE)

Arguments

data

A projection dataset.

biomarkers

A character vector indicating the names of the biomarkers included in the Phenotypic Age algorithm.

fit

An S3 object for model fit. If the value is NULL, then the parameters to use for training Phenotypic Age are calculated.

orig

TRUE to compute the origianl Phenotypic Age.

Details

Projecting Phenotypic Age algorithm onto new data.

Value

An object of class "phenoage". This object is a list with two elements (data and fit). The dataset can be drawn by typing 'data'. The model can be drawn by typing 'fit'.

Examples

#Train using the NHANES III
train = phenoage_calc(NHANES3,
                      biomarkers = c("albumin_gL","lymph","mcv","glucose_mmol",
                      "rdw","creat_umol","lncrp","alp","wbc"))

#Project into the NHANES IV
phenoage = phenoage_calc(NHANES4,
                         biomarkers = c("albumin_gL","lymph","mcv","glucose_mmol",
                         "rdw","creat_umol","lncrp","alp","wbc"),
                         fit = train$fit)

#Extract phenoage dataset
data = phenoage$data



dayoonkwon/BioAge documentation built on Oct. 11, 2023, 1:33 a.m.