add_dis_age: Easily add the disease-related age variable to a data frame

View source: R/main-datautil.R

add_dis_ageR Documentation

Easily add the disease-related age variable to a data frame

Description

Creates the disease-related age covariate vector based on the disease initiation times and adds it to the data frame

Usage

add_dis_age(data, t_init, id_var = "id", time_var = "age")

Arguments

data

the original data frame

t_init

A named vector containing the observed initiation or onset time for each individual. The names, i.e. names(t_init), should specify the individual id.

id_var

name of the id variable in data

time_var

name of the time variable in data

Value

A data frame with one column added. The new column will be called dis_age. For controls, its value will be NaN.

See Also

Other data frame handling functions: add_factor_crossing(), add_factor(), adjusted_c_hat(), new_x(), split()


jtimonen/lgpr documentation built on Oct. 12, 2023, 11:13 p.m.