veteran (a Cox fit, a standardised
restricted mean survival time contrast and a pseudo-observation
regression) and a table of the functions.predict() on a fit and for the orchestra manifest
methods describe their arguments in the text. They had an argument list
without a usage section, which R-devel's check reports.Remotes: max578/orchestraManifest, so installers that
resolve Suggests from GitHub (pak, remotes) find the orchestraManifest
package. No change to code, tests or results; 0.2.0's estimates stand.The causal survival estimands arrive: arm contrasts that do not rest on proportional hazards, competing risks, pseudo-observations, and planted data with known truths. Every new function is tested against a reference survkit did not produce (survival's own estimators, closed forms, or a second route).
survkit_triangulate() now compares every method on one estimand. With
newdata = NULL the model-based fits are standardised over the sample and
compared with the marginal Kaplan-Meier estimate; with a one-row newdata
the comparison is conditional and Kaplan-Meier is dropped with a warning.
In 0.1.0 Weibull was evaluated at the covariate means (0/1 columns at their
mean), Cox with 0/1 columns at 0, and Kaplan-Meier marginally, so the flag
fired on correctly specified models (false-flag rate 0.72 at log hazard
ratio -1 in the diagnosis design; 0.000 now). threshold now counts
standard errors of the Kaplan-Meier estimate (default 2) instead of a
relative spread (0.10). The result gains estimand, and the disagreement
table gains scale_se and spread_se. The flag rarely fires on
misspecified hazards either, which the help now states.survkit_logrank(): the log-rank test, optionally stratified.survkit_ph_check(): the Grambsch-Therneau test of proportional hazards
for each term, and the hazard ratio in time windows.survkit_contrast(): survival at given times and restricted mean survival
time (RMST) by arm, and their differences from a reference arm;
standardised over the sample for Cox, parametric, spline and cure fits
(with the cured-fraction contrast for cure fits), unadjusted for
Kaplan-Meier. Intervals by the delta method (Kaplan-Meier) or a seeded
bootstrap within arm.survkit_cr_contrast(): cumulative incidence of a cause and time lost to
it, by arm, from the Aalen-Johansen estimator or standardised from
cause-specific Cox models.survkit_pseudo(): pseudo-observations for survival, RMST, cumulative
incidence and time lost, regressed on arm and covariates with a sandwich
(HC0) variance.survkit_split() and survkit_from_hazard_draws(): a piecewise-exponential
Poisson layout, and draws of interval hazards turned into draws of
standardised survival, RMST, cumulative incidence and time lost.survkit_simulate(): recurrence and death planted on a data set's arms and
covariates (piecewise-constant rates, fading and covariate-dependent arm
effects, administrative censoring), with each estimand's true value
computed by exact integration and by Monte Carlo.as_orchestra_manifest() methods (with orchestraManifest installed) for
fits, contrasts, triangulations, refusals and the legacy
survkit_manifest.survkit_ic(): AIC and BIC across fits, labelled by likelihood type.survkit_stack(): several event types per subject stacked for a marginal
Cox model with strata(etype) and a cluster identifier.survkit_refusal_<reason>, survkit_refusal, orchestra_refusal).veteran and mgus2.print() on a survkit_triangulation printed a bare list under S7 1.0.0;
every S3 print method is now registered against base print.survkit_triangulate() kept only the first row when a model had only
factor covariates; standardisation removes the case.First release under the new name. It follows survkit 0.2.2, whose entries below keep the old names.
The default method of survestimand() is "cox", which needs only
survival. It was "weibull", which needs the suggested flexsurv.
# before: a Weibull fit, or an error without flexsurv
survestimand(Surv(time, status) ~ age, lung)
# now: a Cox fit; ask for Weibull by name
survestimand(Surv(time, status) ~ age, lung, method = "weibull")
The package is renamed from survkit to survestimand. survkit() is now
survestimand(), and every other survkit_* function is now sest_*
(for example sest_contrast(), sest_rmst()), as are
as_sest_manifest(), is_sest_refusal() and the refusal classes
(sest_refusal_<reason>). The old names are gone, with no aliases.
survkit_triangulate() is removed. In simulations with a misspecified
model it flagged at most 6.5 % of replicates (0 % at the default
threshold), so it did not detect misfit.
Every exported function checks its inputs and refuses malformed or
degenerate ones with a typed condition: an argument of the wrong type or
range, a response with infinite or negative times, data with no complete
rows or no events, an unregistered method, a missing backend. An error
raised inside a backend is signalled again as
sest_refusal_backend_error and carries the backend's message.
?sest_refusal lists the reason codes.
sest_curve() and sest_rmst() refuse competing-risk and recurrent-event
fits, whose hazards do not integrate to a survival probability.
sest_score() refuses frailty, interval-censored and recurrent-event fits.
sest_score() on a Kaplan-Meier fit with groups scores each subject on
its own group's curve. It spread the stacked group curves over the rows in
turn, so the C-index and Brier score were wrong (veteran by trt at day
100: C 0.497, own-arm 0.525).sest_score() drops rows with a missing response or covariate before it
predicts, as it already did for the response. It stopped with a plain
"differing number of rows" error on such data.sest_score() estimates the censoring distribution with events before
censoring at a tied time and weights a death by the censoring survival just
before it, so the Brier score and IPA equal those of riskRegression. They
differed in the fourth decimal place on data with tied times.sest_curve() numbers the curves of a parametric, spline or cure fit by
the row of newdata they are for, and labels the curves of a Kaplan-Meier
fit by a variable with a group column. Every curve was labelled
profile = 1.k, theta, ties), so a bootstrap refit in sest_contrast()
reuses them. The refit evaluated their expressions again in the formula's
environment and could pick up another object of the same name.sest_contrast() refuses data whose complete rows differ from the fit's
in number or in events (sest_refusal_different_data). It standardised
over whatever data it was given and refitted the bootstrap on it.sest_power() gains cause: for a multi-state response it counts the
events of that cause, and survestimand() passes the cause of a
fine_gray fit. The gate gave "unknown" for every competing-risks
response, so fine_gray never warned or abstained. A multi-state response
without cause warns that the gate did not run.sest_simulate() refuses a reference that is not a level of the arm and
times that are not positive and finite. It returned truths for an arm
that did not exist and ran with times = -1.coxph or survfit), not from
the method's kind, and a registered method on any other backend is
refused with sest_refusal_not_supported. A "parametric" method on
survival::survreg(), as in the sest_register() example, ended in
errors without a refusal class. sest_register() checks kind.sest_tidy() reports a ratio only for hazard, time and odds ratios. It
exponentiated probit-scale spline coefficients and the coefficients of a
fit that declared no ratio type (an intercept of 1261 read as a ratio).sest_tidy() reports no ratio for method = "gamma". flexsurv puts its
covariates on the rate, so exp(coefficient) is the inverse of a time
ratio; it was labelled a time ratio (lung, sex: 0.65 for a time ratio of
about 1.54).as_sest_manifest() draws the coefficients from their covariance with
base R, and refuses a fit without a finite covariance matrix
(sest_refusal_no_covariance). Without MASS it drew independent normals
that ignored the covariance, and without a covariance it drew with unit
variance, in both cases silently.sest_tidy() names a flexsurv baseline parameter by the scale of its
estimate, for example log(shape) and logit(theta). The log-scale
estimates were reported under the plain names shape and scale.sest_rmst() refuses a tau past the last observed time
(sest_refusal_horizon_beyond_data) and a Cox fit with a (start, stop]
response. It extended the last value of the curve past follow-up.sest_ph_check() refuses a fit with ties = "exact" with
sest_refusal_not_supported; it stopped with a plain error. The
power-gate refusal carries the class sest_refusal_underpowered, like
every other refusal.sest_ic() and logLik() count the degrees of freedom the backend
reports, so a cox_ridge or frailty fit uses its effective degrees of
freedom. They counted the coefficients.sest_cr_contrast(method = "aalen_johansen") refuses a formula with
variables besides the arm, which it ignored. The contrast functions take
the reference of a numeric arm as a number or a string; "2" ended in
a plain contrasts error.cluster and istate are evaluated in data and passed to the backend,
like weights and id. cluster = inst ended in "object not found".sest_split() numbers .id by the row of data, not by the row among
the complete rows, and refuses a time of 0, whose row it dropped.
sest_from_hazard_draws() checks cuts, arm, data and formula
first; unsorted cuts ended in a base R error.sest_curve() and sest_rmst() says what the default
profile is: the covariate means, which for a 1/2 arm is 1.5.sest_rmst() gains conf_level and returns the same columns for every
kind of fit: profile (the row of newdata, or the group) and group
(the group label of a Kaplan-Meier fit, otherwise NA). It returned
group or profile depending on the fit and always a 95 % interval.sest_contrast() and sest_cr_contrast() refuse an n_boot that is not
a whole number.subset is
refused.n_mc of sest_simulate() is 1e5. At 1e6 the two-arm
help example peaked about 330 MB higher.method = "cox_ridge" codes factors as treatment-contrast dummies.
Previously a factor was penalised as a single numeric column.weights and id are evaluated in data and passed to every method.
Andersen-Gill no longer picks up an unrelated column called id.subset is applied before the power check.method = "cure" accepts weights. method = "fine_gray" stops with an
error when given weights or id.sest_contrast() refit each replicate with the
original weights, spline k and ridge theta, which were previously
ignored.sest_contrast() uses the fit's weights for both Kaplan-Meier and
standardised model contrasts, and bootstraps by subject when the fit has
an id. It stops with an error for counting-process (start, stop]
responses and for Kaplan-Meier fits stratified by anything other than the
arm.sest_power() counts model parameters, not formula terms: a 4-level
factor counts 3.sest_power() and sest_score() work on formulas with strata() or
cluster() without attaching survival. Previously the power check
returned "unknown" and sest_score() failed on stratified Cox fits.sest_rmst() for parametric fits gains a seed argument and returns a
standard error.as_sest_manifest(seed = ) no longer changes the global random-number
state.sest_rmst() and
sest_score() on competing-risk fits, sest_ph_check() on fits with a
clustered (robust) variance, sest_rmst() and sest_curve() on frailty
and interval-censored fits, and weights, id or subset passed to
sest_cr_contrast().sest_ic()
gives them an AIC. It was missing.sest_score() stops with an error when the concordance cannot be
computed. It returned NA.sest_simulate() refuses an effect named for a transition the model does
not have, which it ignored, and a non-positive n_mc.Remotes:. orchestraManifest, a suggested package,
installs from https://max578.r-universe.dev, which DESCRIPTION lists
under Additional_repositories.First public release. The registry-dispatched facade of the development scaffold gains its value layer: the decision-relevant estimands and the cross-method consistency checks that make survkit a methodology rather than a wrapper.
survkit_tidy() no longer exponentiates a parametric fit's baseline
parameters into a meaningless ratio, and it now labels each covariate effect
by scale. The output gains a component column ("covariate" /
"auxiliary") and a ratio_type column ("HR" / "TR" / "OR" / probit).
# before: shape and scale were listed as covariates with a bogus "ratio"
# term estimate ratio
# scale 6.27 531.0 <- exponentiated log-scale intercept
# sex 0.38 1.47 <- a time ratio, unlabelled
# after: auxiliaries are separated, covariates carry their ratio type
# term component estimate ratio_type ratio
# scale auxiliary 6.27 <NA> NA
# sex covariate 0.38 TR 1.47
survkit_curve() returns its predicted quantity in a column named value
(was survival), because the function now predicts hazard, cumulative hazard
and quantiles as well as survival.
survkit_triangulate() fits the same data under several methods and reads
their relative spread on the restricted mean (and, optionally, survival at a
landmark) as a model-misspecification signal.survkit_rmst() computes the restricted mean survival time to a horizon, with
the backend's interval for parametric fits and the survival package's standard
error for Cox-family and non-parametric fits.survkit_cuminc() gives the Aalen-Johansen cumulative incidence of each
competing event.survkit_score() scores predictions with Harrell's concordance and the
inverse-probability-of-censoring-weighted Brier score and its index of
prediction accuracy.survkit_contract() and survkit_validate_method() expose and check the
registry conformance contract every fit closure must honour.km (Kaplan-Meier / Nelson-Aalen non-parametric
baseline) and cox_ridge (ridge-penalised Cox for the few-events regime).survkit_curve() gains a type argument ("survival", "hazard",
"cumhaz", "quantile").as_survkit_manifest() now emits a genuine per-draw survival ensemble for
parametric, spline and cure fits (the draws and the survival share one sample);
Cox-family fits emit the maximum-likelihood curve marked draw = 0.survkit() gains an on_underpowered = c("warn", "abstain") argument.
"warn" preserves the historical behaviour (fit anyway, with a warning);
"abstain" declines to fit an under-powered model and instead returns a
[survkit_refusal()] -- a typed, classed token (c("survkit_refusal", "orchestra_refusal", "error", "condition")) recognisable to a leader-side
gate via is_orchestra_decline(), rather than a bare warning() plus a
fitted model regardless of the power gate's verdict."unknown" for a multi-state (competing-risks)
response rather than pooling the competing events into one misleading count.model = TRUE), so survival curves
and scoring on new data work reliably.survkit_fit carries ratio_type and aux_pars so the tidier can separate
covariate effects from baseline parameters for any backend.README.md leads with the package's purpose in the first lines, and every
code snippet is now self-contained and runnable end-to-end on
survival::lung / survival::mgus2 (the Fine-Gray, small-sample-gate and
scoring snippets previously referenced undefined objects).@titles rewritten as sentences/imperatives rather than
noun phrases (survkit_power, survkit_fit, survkit_manifest,
survkit_contract, survkit_cuminc, survkit_rmst, survkit_curve);
@examples added for survkit_fit, survkit_manifest and the predict
method on a fit (previously undocumented by example); @references added
to survkit_power and survkit_score; governing-equation @details
added to survkit_rmst and survkit_score.