Wrapper function to fit fine and gray competing risk model using function crr from package cmprsk

crrRx(f, data)

Arguments

f

formula for the model. Currently the formula only works by using the name of the column in a dataframe. It does not work by using $ or [] notation.

data

dataframe containing data

Value

a competing risk model with the call appended to the list

See also

Examples

# From the crr help file:
set.seed(10)
ftime <- rexp(200)
fstatus <- sample(0:2,200,replace=TRUE)
cov <- matrix(runif(600),nrow=200)
dimnames(cov)[[2]] <- c('x1','x2','x3')
df <- data.frame(ftime,fstatus,cov)
m1 <- crrRx(as.formula('ftime+fstatus~x1+x2+x3'),df)
# Nicely output to report:
rm_mvsum(m1,data=df,showN = TRUE,vif=TRUE)
#> Warning: The `data` argument of `rm_mvsum()` is deprecated as of reportRmd 0.1.1.
#> Variance inflation factor can not be calculated
#> <table class="table table" style="margin-left: auto; margin-right: auto; margin-left: auto; margin-right: auto;">
#>  <thead>
#>   <tr>
#>    <th style="text-align:left;position: sticky; top:0; background-color: #FFFFFF;">  </th>
#>    <th style="text-align:right;position: sticky; top:0; background-color: #FFFFFF;"> HR(95%CI) </th>
#>    <th style="text-align:right;position: sticky; top:0; background-color: #FFFFFF;"> p-value </th>
#>    <th style="text-align:right;position: sticky; top:0; background-color: #FFFFFF;"> N </th>
#>    <th style="text-align:right;position: sticky; top:0; background-color: #FFFFFF;"> Event </th>
#>   </tr>
#>  </thead>
#> <tbody>
#>   <tr>
#>    <td style="text-align:left;"> <span style="font-weight: bold;">x1</span> </td>
#>    <td style="text-align:right;"> 1.31 (0.57, 2.98) </td>
#>    <td style="text-align:right;"> 0.53 </td>
#>    <td style="text-align:right;"> 200 </td>
#>    <td style="text-align:right;"> 69 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> <span style="font-weight: bold;">x2</span> </td>
#>    <td style="text-align:right;"> 0.95 (0.45, 2.00) </td>
#>    <td style="text-align:right;"> 0.88 </td>
#>    <td style="text-align:right;"> 200 </td>
#>    <td style="text-align:right;"> 69 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> <span style="font-weight: bold;">x3</span> </td>
#>    <td style="text-align:right;"> 1.32 (0.63, 2.79) </td>
#>    <td style="text-align:right;"> 0.46 </td>
#>    <td style="text-align:right;"> 200 </td>
#>    <td style="text-align:right;"> 69 </td>
#>   </tr>
#> </tbody>
#> </table>