get_evmat2: A matrix for event data

Description Usage Arguments Examples

Description

This function returns a matrix describing event data in the form date, id, location, special, status. Here, gemini births count as one single event (see get_evmat_twins() for including the birth of twins as multiple events).

Usage

1
2
3
get_evmat2(df_ev = NULL, vars = list(evdat = "evdat", evid = "evid", evloc =
  "evloc", evspc = "evspc", status = "status", evtyp = "evtyp", id = "id"),
  events = list(birth = "*", child = "#", death = "+"), censored = FALSE)

Arguments

df_ev

A dataframe in long format containing individual events

vars

A list of variables for chronological date, ID related to event, location, special, status, and type of event)

events

A list of labels used in vars[["evtyp"]] to indicate births, born children, and deaths

censored

A logical indicator, whether censored dates should be included (Default is FALSE)

Examples

1
2
3
4
5
## Not run: 
df_fam <- data.frame(idf = c(0,unique(df_ind$momid[df_ind$momid>0])), fall = "C")
evmat <- get_evmat(df_ind, df_fam)

## End(Not run)

johow/kinlab documentation built on July 5, 2019, 4:23 p.m.