makeAgeVars: Function for making Age and AgeCat variables

View source: R/setData.R

makeAgeVarsR Documentation

Function for making Age and AgeCat variables

Description

Function for making Age and AgeCat variables

Usage

makeAgeVars(dat, time2 = NULL, age_cut = NULL, birthdate = NULL)

Arguments

dat

A dataset

time2

The name of a date variable that is used to calculate the Age variable using the getBirthDate function. Age is calculated as (time2 - birthdate)/365.35.

age_cut

Vector of ages to make age categories, default is to use values from AgeCat in link{setArgs}.

birthdate

Dataset of birthdates, if NULL it uses getBirthDate.

Value

data.frame

Examples

hiv <- makeAgeVars(dat=getHIV(), age_cut=c(15, 20, 25, 30, 40, 50))

vando026/ahri documentation built on Aug. 10, 2024, 3:20 p.m.