Construct the typed "will not fit" token survestimand() returns when
on_underpowered = "abstain" and the events-per-variable gate
(sest_power()) flags the model as under-powered. Not signalled as a
condition – returned as an ordinary value, so a caller inspects it with
is_sest_refusal() and needs no tryCatch().
Arguments
- power
A power-gate result from
sest_power(), already flaggedunderpowered.
Value
A classed list with class c("sest_refusal_underpowered", "sest_refusal", "orchestra_refusal", "error", "condition") and elements
reason, n, n_events, n_predictors, events_per_variable,
min_epv, underpowered (always TRUE), message.
Reason codes
Every refusal carries a reason. The value this function returns has
reason = "underpowered". The other refusals are signalled as errors of
class sest_refusal_<reason> and sest_refusal, so a caller can catch one
reason, for example tryCatch(expr, sest_refusal_no_events = function(e) NULL).
| Reason | Raised when |
underpowered | the events-per-variable gate flags the model |
bad_argument | an argument has the wrong type, length or range |
bad_response | the response is not a survival::Surv() object of the type the function takes, or its times are infinite or negative |
no_data | data has no complete rows |
no_events | the response has no events |
not_estimable | no coefficient of the model can be estimated |
unknown_method | the method is not in the registry (sest_methods()) |
backend_missing | the package the method needs is not installed |
backend_error | the backend stopped; the message carries its error |
not_supported | the function does not answer for this kind of fit or option |
not_cox | sest_ph_check() was given a fit that is not method = "cox" |
no_coefficients | the fit has no coefficients to draw from |
no_covariance | the fit has no usable covariance matrix to draw from |
arm_not_in_model | the arm is not a term of the formula |
horizon_beyond_data | the horizon is past the last observed time in an arm |
empty_window | a window of sest_ph_check() has no events |
one_group | the log-rank test was given a single group |
singular_variance | a log-rank group has no events at risk |
rank_deficient | the pseudo-observation design matrix is rank deficient |
bootstrap_failed | a bootstrap refit failed; the message gives the first error |
different_data | sest_ic() was given fits on different numbers of rows |
name_clash | data already has a column sest_stack() adds |
truth_routes_disagree | sest_simulate()'s exact and Monte Carlo truths disagree |
See also
survestimand(), sest_power(), is_sest_refusal().
Other model-fitting:
is_sest_refusal(),
sest_cuminc(),
sest_ic(),
sest_power(),
sest_rmst(),
sest_score(),
sest_stack(),
survestimand()
Examples
set.seed(1)
df <- data.frame(time = rexp(20), status = rbinom(20, 1, 0.2),
x1 = rnorm(20), x2 = rnorm(20))
p <- sest_power(survival::Surv(time, status) ~ x1 + x2, df)
r <- sest_refusal(p)
is_sest_refusal(r)
#> [1] TRUE
