compcomp: Data structured for glm approach in competing risk setting

Description Usage Arguments Value Author(s) Examples

View source: R/matchcif.R

Description

Data structured for glm approach in competing risk setting

Usage

1
2
compcomp(formula, data, cluster, idControl, strata = NULL, time.points,
  cens.formula = NULL, cens.code = 0, event = 1)

Arguments

formula

formula with 'Event' outcome (see timereg package); time stands for the start time, while time2 stands for the stop time. cause=1 will be considered as the event of interest

data

data frame

cluster

vector cluster indicator (one cluster for each exposed individual)

idControl

vector control indicator (idControl==1 indicates exposed individual in cluster i)

strata

weights computed according to strata

time.points

vector of time points where the glm will be estimated (10 usually is a sufficient number; the more time points, the slower the glm function)

cens.formula

useful to estimate the weights when censoring is present. no quotes, add something like ~age+year

cens.code

default is 0

event

in which event are you interested in?

Value

A setup dataset, ready for geese

Author(s)

Cristina Boschini

Examples

1
2
3
4
5
6
7
8
dcif<-sim.data.MatchCR(nca=1000, ncont=5)
tp<-c(0.5,1,2,5,10,15,25)
setdcif1<-compcomp(timereg::Event(time=FALSE,time2=time,cause=cause)~X1+X2,
 data=dcif, cluster=i, idControl=j, time.points=tp, cens.formula=NULL, event=1)
head(setdcif1, 10)
setdcif2<-compcomp(timereg::Event(time=FALSE,time2=time,cause=cause)~X1+X2,
 data=dcif, cluster=i, idControl=j, time.points=tp, cens.formula=NULL, event=2)
head(setdcif2, 10)

cribosch/matchsurv documentation built on Aug. 15, 2019, 11:55 a.m.