Alive | R Documentation |
Determines living status of individual at given age or calendar date. The living status is requested for ego or kin. If the number provided is less than 200, the number is interpreted as age.
Alive(idref, refA)
idref |
vector of IDs. |
refA |
calendar date (decimal date) or age at which survival status of individuals should be determined. Dates can differ between individuals, but number of dates must be same as number of individuals. |
alive_kin |
Living status of ego (if id is a vector) or kin (if id is a dataframe) |
# Load the data
data(dLH,package="Families")
# Select members of generation 1
idego <- dLH$ID[dLH$gen==1]
# Are egos alive at age 18?
alive <- Alive(idref=idego,refA=18)
# Number alive and deceased
tab <- table (alive)
## Is ego alive at 18th birthday of oldest child?
date <- sapply(idego,function(x) min(Db(IDch(x))+18))
alive <- Alive(idego,refA=date)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.