Summarise number of people, number of events, and sum of person time by group.

table_pt(data, id_var = "bbv_id", outcome, vars, pt, var_col = TRUE)

Arguments

data

Input dataset.

id_var

unique identifier for individuals in dataset.

outcome

binary outcome (outcome = 1).

vars

Variables by which to group.

pt

Variable containing person time.

var_col

Option to include variable name as a separate column.

Value

Dataframe

Examples

if (FALSE) { # \dontrun{
table_pt(data, id_var="bbv_id", outcome="drd", vars=c("sex", "hb"), pt="person-years")
} # }