kdm_calc: kdm_calc

kdm_calcR Documentation

kdm_calc

Description

Project KDM algorithm onto new data.

Usage

kdm_calc(data, biomarkers, fit = NULL, s_ba2 = NULL)

Arguments

data

A projection dataset.

biomarkers

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

fit

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

s_ba2

A particular fit parameter. Advanced users can modify this parameter to control the variance of KDM Biological Age. If left NULL, defaults are used.

Details

Projecting KDM algorithm onto new data.

Value

An object of class "kdm". 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 = kdm_calc(NHANES3,
                 biomarkers = c("fev","sbp","totchol","hba1c","albumin",
                 "creat","lncrp","alp","bun"))

#Project into the NHANES IV
kdm = kdm_calc(NHANES4,
               biomarkers = c("fev","sbp","totchol","hba1c","albumin",
               "creat","lncrp","alp","bun"),
               fit = train$fit,
               s_ba2 = train$fit$s_ba2)

#Extract KDM dataset
data = kdm$data



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