h_unbiased_means_across_strata: Check Unbiased Means of Residuals Across Randomization Strata...

View source: R/bias.R

h_unbiased_means_across_strataR Documentation

Check Unbiased Means of Residuals Across Randomization Strata and Treatment Groups

Description

This function checks whether the means of residuals are approximately zero across specified randomization strata for each of the two treatment groups. It is used in robin_surv() downstream functions to verify the correct inclusion of randomization strata variables in the analysis survival model.

Usage

h_unbiased_means_across_strata(
  residuals_per_group,
  df,
  randomization_strata,
  eps = sqrt(.Machine$double.eps)
)

Arguments

residuals_per_group

(list of numeric) A named list of numeric vectors containing residuals for each of the two treatment groups.

df

(data.frame) The data frame containing the treatment and randomization strata variables, produced by h_derived_outcome_vals() or h_strat_derived_outcome_vals().

randomization_strata

(character) A character vector of names of the randomization strata variables in df.

eps

(numeric) A small tolerance value to determine if means are close to zero.

Value

TRUE if the means of residuals across randomization strata are within the specified tolerance for both treatment groups, FALSE otherwise.

See Also

bias() for the underlying bias (means of residuals) calculation.


RobinCar2 documentation built on Jan. 9, 2026, 9:06 a.m.