Learn R Programming

Biograph (version 1.0)

CMC.ages: From CMC to age

Description

The function transforms a Biograph object with dates in CMC to a Biograph object with ages at events and transitions. The dates of the events included in the list of covariates are also converted to age.

Usage

CMC.ages(survey, covsCMC)

Arguments

survey
Biograph object
covsCMC
Names of covariates that are dates of events.

Value

  • Biograph object with date of event or transition replaced by age at event or transition

Details

Some covariates are events. For instance, the date at marriage may be a covariate in labour force studies. The date at marriage is converted to age.

See Also

AgeTrans

Examples

Run this code
data(GLHS)
 # Example 1:dates in covariates are converted to age
  covsCMC <- c("marriage","TE")
  surveyA <- CMC.ages(GLHS,covsCMC)
 # Example 2:dates in covariates are not converted to age
 covsCMC <- NULL
  surveyA <- CMC.ages(GLHS,covsCMC)

Run the code above in your browser using DataLab