# doubleFGR: Double CIF Fine-Gray model with two causes In mets: Analysis of Multivariate Event Times

 doubleFGR R Documentation

## Double CIF Fine-Gray model with two causes

### Description

Estimation based on derived hazards and recursive estimating equations. fits two parametrizations 1)

F_1(t,X) = 1 - \exp( - \exp( X^T β ) Λ_1(t))

and

F_2(t,X_2) = 1 - \exp( - \exp( X_2^T β_2 ) Λ_2(t))

or restricted version 2)

F_1(t,X) = 1 - \exp( - \exp( X^T β ) Λ_1(t))

and

F_2(t,X_2,X) = ( 1 - \exp( - \exp( X_2^T β_2 ) Λ_2(t)) ) (1 - F_1(∞,X))

### Usage

```doubleFGR(formula, data, offset = NULL, weights = NULL, X2 = NULL, ...)
```

### Arguments

 `formula` formula with 'Event' `data` data frame `offset` offsets for cox model `weights` weights for Cox score equations `X2` specifies the regression design for second CIF model `...` Additional arguments to lower level funtions

Thomas Scheike

### Examples

```res <- 0
data(bmt)
bmt\$age2 <- bmt\$age
newdata <- bmt[1:19,]
if (interactive()) par(mfrow=c(5,3))

## same X1 and X2
pr2 <- doubleFGR(Event(time,cause)~age+platelet,data=bmt,restrict=res)
if (interactive()) {
bplotdFG(pr2,cause=1)
}
pp21 <- predictdFG(pr2,newdata=newdata)
pp22 <- predictdFG(pr2,newdata=newdata,cause=2)
if (interactive()) {
plot(pp21)
}
pp21 <- predictdFG(pr2)
pp22 <- predictdFG(pr2,cause=2)
if (interactive()) {
plot(pp21)
}

pr2 <- doubleFGR(Event(time,cause)~strata(platelet),data=bmt,restrict=res)
if (interactive()) {
bplotdFG(pr2,cause=1)
}
pp21 <- predictdFG(pr2,newdata=newdata)
pp22 <- predictdFG(pr2,,newdata=newdata,cause=2)
if (interactive()) {
plot(pp21)
}
pp21 <- predictdFG(pr2)
pp22 <- predictdFG(pr2,cause=2)
if (interactive()) {
plot(pp21)
}

## different X1 and X2
pr2 <- doubleFGR(Event(time,cause)~age+platelet+age2,data=bmt,X2=3,restrict=res)
if (interactive()) {
bplotdFG(pr2,cause=1)
}
pp21 <- predictdFG(pr2,newdata=newdata)
pp22 <- predictdFG(pr2,newdata=newdata,cause=2)
if (interactive()) {
plot(pp21)
}
pp21 <- predictdFG(pr2)
pp22 <- predictdFG(pr2,cause=2)
if (interactive()) {
plot(pp21)
}

### uden X1
pr2 <- doubleFGR(Event(time,cause)~age+platelet,data=bmt,X2=1:2,restrict=res)
if (interactive()) {
bplotdFG(pr2,cause=1)
}
pp21 <- predictdFG(pr2,newdata=newdata)
pp22 <- predictdFG(pr2,newdata=newdata,cause=2)
if (interactive()) {
plot(pp21)
}
pp21 <- predictdFG(pr2)
p22 <- predictdFG(pr2,cause=2)
if (interactive()) {
plot(pp21)
}

### without X2
pr2 <- doubleFGR(Event(time,cause)~age+platelet,data=bmt,X2=0,restrict=res)
if (interactive()) {
bplotdFG(pr2,cause=1)
}
pp21 <- predictdFG(pr2,newdata=newdata)
pp22 <- predictdFG(pr2,newdata=newdata,cause=2)
if (interactive()) {
plot(pp21)