plotSubset: #' Evaluate information criteria for regression model

plotSubsetR Documentation

#' Evaluate information criteria for regression model

Description

This function plots various information criteria and model fit statistics against the number of terms or the adjusted R-squared, depending on the type of plot selected. It helps in model selection by visualizing different aspects of model performance. Models which did not pass the consistency check are depicted with an empty circle; the automatically selected model is highlighted in red. If BIC-weighted model averaging was applied (averaging = TRUE), a caption indicates that the final coefficients are a weighted combination of the consistent candidate models shown.

Usage

plotSubset(model, type = 0)

Arguments

model

The regression model from the bestModel function or a cnorm object.

type

Integer specifying the type of plot to generate:

  • 0: Adjusted R2 by number of terms (default)

  • 1: Log-transformed Mallows's Cp by adjusted R2

  • 2: Bayesian Information Criterion (BIC) by adjusted R2

  • 3: Root Mean Square Error (RMSE) by number of terms

  • 4: Residual Sum of Squares (RSS) by number of terms

  • 5: F-test statistic for consecutive models by number of terms

  • 6: p-value for model tests by number of terms

Details

The function generates different plots to help in model selection:

- For types 1 and 2 (Mallows's Cp and BIC), look for the "elbow" in the curve where the information criterion begins to drop. This often indicates a good balance between model fit and complexity. - For type 0 (Adjusted R2), higher values indicate better fit, but be cautious of overfitting with values approaching 1. - For types 3 and 4 (RMSE and RSS), lower values indicate better fit. - For type 5 (F-test), higher values suggest significant improvement with added terms. - For type 6 (p-values), values below the significance level (typically 0.05) suggest significant improvement with added terms.

The F-tests and p-values compare each model with the preceding (smaller) one, with degrees of freedom based on the actual difference in the number of parameters. After consistency screening, consecutive models may differ by more than one term.

Value

A ggplot object representing the selected information criterion plot.

Note

It's important to balance statistical measures with practical considerations and to visually inspect the model fit using functions like plotPercentiles.

See Also

bestModel, plotPercentiles, printSubset

Other plot: compare(), plot.cnorm(), plot.cnormBetaBinomial(), plot.cnormBetaBinomial2(), plotDensity(), plotDerivative(), plotNorm(), plotNormCurves(), plotPercentileSeries(), plotPercentiles(), plotRaw()

Examples

## Not run: 
# Compute model with example data and plot information function
cnorm.model <- cnorm(raw = elfe$raw, group = elfe$group)
plotSubset(cnorm.model)

# Plot BIC against adjusted R-squared
plotSubset(cnorm.model, type = 2)

# Plot RMSE against number of terms
plotSubset(cnorm.model, type = 3)

## End(Not run)


cNORM documentation built on July 13, 2026, 5:08 p.m.