estimate_ipwhr is a function that estimates the hazard ratio for a treatment with a right-censored outcome using inverse-probablity weighted estimation. Weights can be constructed to account for unequal treatment probabilities.

estimate_ipwhr(
  data,
  models,
  wt = NULL,
  tau = NULL,
  labels = NULL,
  subgroup = NULL,
  subgroup_ps = TRUE,
  wt_type = "i",
  trim = NULL,
  trunc = NULL,
  ref = NULL
)

Arguments

data

The input data frame

models

A model_specification object describing the incoming data, including the names of the variables containing the outcome (as a time-to-event), treatment, censoring, and associated models. The outcome and censoring times should be NA if they are censored). If no identify_missing statement was included in the model_specification, the estimator will default to a complete-case (listwise deletion) analysis. The model specification is not allowed to include identify_competing because estimate_ipwhr does not currently support competing risks. The identify_censoring statement is not allowed to include a formula with a term on the right-hand side other than 1 (i.e. an intercept) because estimate_ipwhr does not currently support inverse probability of censoring weights.

wt

An optional vector of pre-computed weights to be applied to the analysis

tau

Either NULL or a positive numeric value indicating a point at which all data will be considered to be censored. Thus if tau is non-NULL and a subject has an observed event or censoring time that occurs after tau then they will be considered to have been censored at tau. When tau is NULL, then no artificial censoring is imposed.

labels

vector of strings that are used to describe analysis, used for faceting

subgroup

An expression indicating which observations to include in the analysis

subgroup_ps

A logical indicating whether the PS should be re-estimated within the subgroup (default = TRUE)

wt_type

The type of confounding weight used, "i"=IPTW (default), "n"=IPTW normalized to sum to \(n\) in each treatment group, or a numeric indicating which group to use as a standard in an SMR weight.

trim

A scalar value (between 0 and 0.5) providing the thresholds for symmetrical propensity score trimming. For example, trim = 0.01 will drop observations with propensity scores below to the 1st percentile and above the 99th percentile (default = NULL, no trimming).

trunc

A scalar value (between 0 and 1) providing the top percentile at which to truncate confounding weights. For example, trunc = 0.99 will truncate all weights above the 99th percentile, i.e., weights larger than the 99th percentile will be set equal to the 99th percentile (default = NULL, no truncation).

ref

Either NULL or a string specifying the category to use as the reference for hazard ratios. When the value is NULL then the reference category is taken to be the category with the earliest name according to alphabetical order.

Value

An object that inherits from classes hr and ipw that contains information about the estimated hazard ratio and IP weights

Author

Nuvan Rathnayaka