View source: R/def_ensemble_gof.R
| def.ensemble.gof | R Documentation |
Combines the three Directed Ebrahim-Farrington (DEF) basis tests
("poly2", "poly3", "stukel") into a single goodness-of-fit
decision, so the user does not have to choose a basis. By default the p-values
are combined with the Cauchy Combination Test (CCT), which controls the error
rate under the strong dependence between tests computed on the same fitted
model. The omnibus EF test can optionally be added to the vote.
def.ensemble.gof(
object,
predicted_probs = NULL,
X = NULL,
components = c("poly2", "poly3", "stukel"),
add_ef = FALSE,
combine = c("cct", "minp", "fisher"),
G = 10,
extra_pvalues = NULL,
weights = c("unit", "score")
)
object |
A fitted binary logistic |
predicted_probs |
Numeric predicted probabilities; required when
|
X |
Optional design matrix, threaded to |
components |
Character vector, a subset of
|
add_ef |
Logical; if |
combine |
One of |
G |
Integer number of groups passed to |
extra_pvalues |
Optional named numeric vector of additional p-values to
include (e.g. a Tsiatis test computed elsewhere). Default |
weights |
|
Because the component tests are computed on the same fit, their p-values are
strongly dependent. The CCT (combine = "cct") has an asymptotic
standard-Cauchy null whose tail is robust to this dependence, so it needs no
calibration. The "minp" (Sidak) and "fisher" rules assume
independence and are offered for comparison only; under positive dependence
"minp" is conservative and "fisher" is anti-conservative, so they
should be calibrated by simulation before use (not done here).
With no event, or no non-event, the model has no maximum-likelihood fit: the
p-value is NA, with one warning of class def_degenerate.
A one-row data.frame with columns Test, Combiner,
Components, k, and p_value.
Ebrahim Khaled Ebrahim ebrahimkhaled@alexu.edu.eg
Liu, Y. and Xie, J. (2020). Cauchy combination test. JASA, 115(529), 393-402.
def.gof, ef.gof.
data("gof_demo", package = "ebrahim.gof")
wrong <- glm(outcome ~ age + bmi + sex + treatment,
data = gof_demo, family = binomial())
def.ensemble.gof(wrong) # CCT of the three DEF bases
def.ensemble.gof(wrong, add_ef = TRUE) # add the omnibus EF
## the corrected model, for contrast
right <- glm(outcome ~ poly(age, 2) + bmi + sex + treatment,
data = gof_demo, family = binomial())
def.ensemble.gof(right)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.