count_event_by: count_event_by: funciton to count event, subgroup number...

View source: R/utils.R

count_event_byR Documentation

count_event_by: funciton to count event, subgroup number inside TableSubgroupCox, TableSubgroupMultiCox

Description

Function to count event, subgroup number

Usage

count_event_by(
  formula,
  data,
  count_by_var = NULL,
  var_subgroup = NULL,
  decimal.percent = 1,
  data_original = NULL,
  formula_original = NULL
)

Arguments

formula

formula with survival analysis

data

same data as in formula

count_by_var

variables to count subgroup for

var_subgroup

1 sub-group variable for analysis,

decimal.percent

decimals to show percent of, Default: 1

data_original

Original data for competing risk analysis (before finegray transformation), Default: NULL

formula_original

Original formula for competing risk analysis (before finegray transformation), Default: NULL

Details

This function is used inside TableSubgroupCox, TableSubgroupMultiCox for calculation. When data_original and formula_original are provided, counts and percentages are calculated from the original data instead of the finegray-transformed data, ensuring accurate event counts in competing risk analysis.

Value

Table with event, subgroup number

See Also

group_by, summarise, mutate, bind_rows, arrange

Examples

## Not run: 
if (interactive()) {

}

## End(Not run)

jstable documentation built on Jan. 27, 2026, 9:07 a.m.