Skip to contents

Performs direct binomial regression modeling for cumulative incidence functions in competing risks analysis using the timereg package. This method provides direct modeling of cumulative incidence without proportional subdistribution hazards assumptions.

Usage

directbinomial(
  data,
  time,
  event,
  covs,
  eventOfInterest = 1,
  times = "1, 3, 5",
  conf = 0.95,
  residuals = FALSE,
  predictions = TRUE,
  bootstrap = FALSE,
  nboot = 500,
  showModel = TRUE,
  showEducational = TRUE,
  plotCIF = TRUE,
  plotResiduals = FALSE
)

Arguments

data

The data as a data frame.

time

Follow-up time variable

event

Event type variable (0=censored, 1=event of interest, 2=competing event, etc.)

covs

Covariates to include in the model

eventOfInterest

Numeric code for the event of interest (primary event)

times

Comma-separated list of time points for cumulative incidence prediction

conf

Confidence level for confidence intervals

residuals

Display model residuals and goodness-of-fit statistics

predictions

Display predicted cumulative incidence at specified time points

bootstrap

Use bootstrap methods for confidence interval estimation

nboot

Number of bootstrap samples (when bootstrap is enabled)

showModel

Display detailed model summary and parameter estimates

showEducational

Display educational information about direct binomial regression

plotCIF

Display cumulative incidence function plots

plotResiduals

Display residual plots for model diagnostics

Value

A results object containing:

results$todoa html
results$modelSummarya table
results$educationalInfoa html
results$coefficientsTablea table
results$cumulativeIncidenceTablea table
results$covariateEffectsTablea table
results$goodnessOfFita table
results$residualAnalysisa html
results$methodsInfoa html
results$cifPlotan image
results$residualPlotan image

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$modelSummary$asDF

as.data.frame(results$modelSummary)

Examples

# \donttest{
# example will be added
# }