Skip to contents

This method formats and prints key statistics and information about the ftmglm or ftmlm object, including the number of predictors used in the model, the formula, and a subset of the model's coefficients. If there are many coefficients, only the first 10 are displayed followed by an ellipsis to indicate truncation.

The method enhances readability and quick assessment of the model without cluttering the output, which is particularly useful for complex models with many predictors or parameters.

Usage

# S4 method for class 'ftmglm'
show(object)

# S4 method for class 'ftmlm'
show(object)

Arguments

object

Object of class inheriting from ftmglm or ftmlm.

Value

This method does not return a value; it is used for its side effect of printing to the console.

Details

The output includes:

  • Model Type: Identifies the model type of model.

  • Number of Predictors: Displays the number of predictors used in the model, not counting the intercept.

  • Formula: Shows the formula used to create the model, derived from the `formula` method for ftmglm or ftmlm objects.

  • Coefficients: Lists the model's coefficients. If the model has more than 10 coefficients, only the first 10 are displayed followed by "..." to indicate more coefficients are available but not shown.

Coefficients are formatted to three decimal places for clarity. This method is useful for quick checks and summaries of the model's parameters and settings without needing to invoke separate summary methods.

Examples

if (FALSE) { # \dontrun{
data(mtcars)
fit <- glmnet::cv.glmnet(as.matrix(mtcars[, c("hp", "wt", "cyl")]), mtcars$am, family = "binomial")
model <- createFromGlmnet(fit, as.matrix(mtcars[, c("hp", "wt", "cyl")]))
print(model)  # This will invoke the custom 'show' method
} # }