f_risksets: Rsiksets

Description Usage Arguments Value Examples

View source: R/f_02_risksets_2.r

Description

Computes the riskset for each case with the relevant variables in the formula and the stratification vars specified in strata() part of the formula. The riskset of a case inculde the subjects that are in the cohort when the case ocurs: so a subject S belongs to the riskset R of the case that have a 'fail' at time ft, if S_entry_time < ft <= S_exit_time.

Usage

1
f_risksets(formula, data, lag, id_name, time_name)

Arguments

formula

Surv(entry_time,exit_time,outcome)~loglin(loglin_var1,..,loglin_varn)+
lin(lin_var1,..,lin_varm)+strata(strat_var1,...strat_varp)

data

event format data set than is ouput of the functions f_to_event...

lag

latency period

id_name

name of variable containing the names of subjects

time_name

name of the time variable

Value

a named list with integer vectors containing the number of rows that are in each the riskset (relevant person-time)

Examples

1
 f_riskset(formula,data,lag=2,id_name='patientids',time_name='time')

rERR documentation built on May 2, 2019, 11:10 a.m.

Related to f_risksets in rERR...