fic (version 1.0.0)

plot.fic: Plot focused model comparison statistics: base graphics method

Description

Plot focused model comparison statistics: base graphics method

Usage

# S3 method for fic
plot(x, ci = TRUE, xlab = NULL, ylab = NULL, xlim = NULL,
  ylim = NULL, pch = 19, mfrow = NULL, ...)

Arguments

x

Output from fic.

ci

Plot interval estimates? (TRUE or FALSE). These are calculated as plus / minus twice the standard error of the submodel focus under the wide model. These are rough estimates of uncertainty intended to illustrate the bias-variance tradeoff, and exclude any uncertainty associated with the choice between models.

xlab

x-axis label.

ylab

y-axis label.

xlim

x-axis limits (pair of numbers)

ylim

y-axis limits

pch

Plot point character, by default 19 (solid circle).

mfrow

Vector of two numbers giving the number of rows and number of columns respectively in the plot grid, if there are multiple focuses.

...

Other options to pass to plot.

Details

If the focus estimates are available, then the focus estimates are plotted against the root MSE. One plot is made for each covariate value defining different focuses. If the wide model estimate is available, this is illustrated as a solid line on the plot, and if the narrow model estimate is available, this is shown as a dashed line.

If the focus estimates are unavailable, then the standard errors of the focus estimate are plotted against the corresponding bias. The plot points are shaded with darkness proportional to the RMSE, with the point of maximum RMSE in black.

The ggplot2-based plot method, ggplot_fic, is slightly nicer.

See Also

ggplot_fic, summary.fic

Examples

Run this code
# NOT RUN {
## Example from the main vignette, see there for more details

wide.glm <- glm(low ~ lwtkg + age + smoke + ht + ui + smokeage + smokeui,
                data=birthwt, family=binomial)
vals.smoke <-    c(1, 58.24, 22.95, 1, 0, 0, 22.95, 0)
vals.nonsmoke <- c(1, 59.50, 23.43, 0, 0, 0, 0, 0)
X <- rbind("Smokers" = vals.smoke, "Non-smokers" = vals.nonsmoke)
inds0 <- c(1,1,0,0,0,0,0,0)
combs <- all_inds(wide.glm, inds0)
ficres <- fic(wide = wide.glm, inds = combs, inds0 = inds0,
              focus = prob_logistic, X = X)
plot(ficres)

# }

Run the code above in your browser using DataCamp Workspace