| gof_demo | R Documentation |
A small, fully synthetic dataset for demonstrating the goodness-of-fit and
calibration battery. It was generated reproducibly (see
data-raw/make_gof_demo.R) from a logistic data-generating process whose
true linear predictor includes a quadratic term in (standardized) age.
A model that regresses outcome on age linearly (together with
bmi, sex and treatment) is therefore mildly
misspecified, through a smooth, low-dimensional calibration distortion. This
is the regime in which the directed Ebrahim–Farrington / EDGE test
(edge.gof, def.gof) is designed to have more power
than classical omnibus tests such as Hosmer–Lemeshow.
gof_demo
A data frame with 800 rows and 5 variables:
binary response, 0/1 (event rate about 0.27).
continuous covariate, years (range about 20–70). The true model depends on age quadratically.
continuous covariate, body mass index in kg/m^2.
binary covariate, 0 = female, 1 = male.
binary covariate, 0 = control, 1 = treated.
The true data-generating linear predictor is
\eta = -0.6 + 0.8 z_a - 0.7 z_a^2 + 0.5 z_b + 0.4\,\mathrm{sex}
- 0.3\,\mathrm{treatment},
where z_a = (\mathrm{age} - 45)/14 and
z_b = (\mathrm{bmi} - 27)/4, and
\Pr(\mathrm{outcome} = 1) = \mathrm{plogis}(\eta).
Simulated; see data-raw/make_gof_demo.R in the package sources.
data("gof_demo", package = "ebrahim.gof")
fit <- glm(outcome ~ age + bmi + sex + treatment,
data = gof_demo, family = binomial)
edge.gof(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.