Skip to contents

Provides a comprehensive summary for one or more shrinkage estimators contained within a savvySh_model object produced by savvySh. The summary includes estimated coefficients, confidence intervals, residual statistics, R-squared measures, F-statistics, and information criteria (AIC, BIC) for each specified estimator.

Usage

# S3 method for class 'savvySh_model'
summary(object, estimator = NULL, ...)

Arguments

object

A fitted model object of class savvySh_model, produced by savvySh.

estimator

A character vector naming one or more estimators to summarize (e.g., "St", "DSh", "SR", "GSR", "Sh", etc.). If NULL (default), summaries for all available estimators are printed.

...

Additional arguments (currently unused).

Value

Invisibly returns a data.frame summarizing key metrics for each estimator (including estimator name, number of non-zero coefficients, and optimal lambda if available).

Details

For each estimator present in the savvySh_model object (or for the user-specified subset), this function computes:

  • A summary of the residual distribution (quantiles).

  • A coefficient table including estimates, standard errors, t-values, p-values, and confidence intervals.

  • Residual standard error and degrees of freedom.

  • R-squared and adjusted R-squared measures.

  • F-statistic (and its p-value) for testing overall regression significance.

  • Information criteria (AIC, BIC) and deviance for model fit.

These results are printed in sequence for the selected estimator(s). If no estimator is specified, summaries for all available estimators are printed.

See also

savvySh for fitting slab and shrinkage linear models, predict.savvySh_model for generating predictions, coef.savvySh_model for extracting coefficients directly.

Author

Ziwei Chen, Vali Asimit, Marina Anca Cidota, Jennifer Asimit
Maintainer: Ziwei Chen <ziwei.chen.3@citystgeorges.ac.uk>

Examples

# Generate simulated data for demonstration
set.seed(123)
x <- matrix(rnorm(100 * 5), 100, 5)
y <- rnorm(100)

# Fit a Slab Regression model
fit <- savvySh(x, y, model_class = "Slab")

# Print a detailed summary for all estimators (SR and GSR)
summary(fit)
#> Summary of savvySh Model
#> ===================================================================
#> 
#> Call:
#> savvySh(x = x, y = y, model_class = "Slab")
#> 
#> 
#> Estimator: SR 
#> 
#> Residuals:
#>          0%         25%         50%         75%        100% 
#> -2.73899446 -0.55639889  0.01915612  0.68404744  2.55646699 
#> 
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)   2.5 % 97.5 % Signif.
#> (Intercept)  -0.0723     0.0957 -0.7552   0.4520 -0.2624 0.1178        
#> V1           -0.0531     0.1059 -0.5018   0.6170 -0.2634 0.1571        
#> V2            0.1063     0.0980  1.0853   0.2806 -0.0882 0.3009        
#> V3           -0.0186     0.0996 -0.1863   0.8526 -0.2164 0.1793        
#> V4           -0.1106     0.0904 -1.2231   0.2244 -0.2901 0.0689        
#> V5            0.1734     0.0975  1.7777   0.0787 -0.0203 0.3671       .
#> 
#> Residual standard error: 0.9311 on 94 degrees of freedom
#> Multiple R-squared: 0.0659 , Adjusted R-squared: 0.0162 
#> F-statistic: 1.3263 on 5 and 94 DF, p-value: 0.2598 
#> AIC: -8.4678 , BIC: 7.1632 , Deviance: 81.491 
#> ===================================================================
#> 
#> Estimator: GSR 
#> 
#> Residuals:
#>          0%         25%         50%         75%        100% 
#> -2.83711278 -0.61385498 -0.01386121  0.60248424  2.40472034 
#> 
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)   2.5 % 97.5 % Signif.
#> (Intercept)  -0.0354     0.0960 -0.3686   0.7132 -0.2261 0.1553        
#> V1           -0.0151     0.1062 -0.1418   0.8876 -0.2260 0.1959        
#> V2            0.1162     0.0983  1.1821   0.2401 -0.0790 0.3114        
#> V3            0.0185     0.1000  0.1847   0.8538 -0.1800 0.2169        
#> V4           -0.0660     0.0907 -0.7281   0.4683 -0.2461 0.1140        
#> V5            0.1089     0.0979  1.1126   0.2687 -0.0854 0.3032        
#> 
#> Residual standard error: 0.9341 on 94 degrees of freedom
#> Multiple R-squared: 0.0599 , Adjusted R-squared: 0.0099 
#> F-statistic: 1.1976 on 5 and 94 DF, p-value: 0.3164 
#> AIC: -7.8264 , BIC: 7.8046 , Deviance: 82.0153 
#> ===================================================================

# Summarize only a specific estimator
summary(fit, estimator = "GSR")
#> Summary of savvySh Model
#> ===================================================================
#> 
#> Call:
#> savvySh(x = x, y = y, model_class = "Slab")
#> 
#> 
#> Estimator: GSR 
#> 
#> Residuals:
#>          0%         25%         50%         75%        100% 
#> -2.83711278 -0.61385498 -0.01386121  0.60248424  2.40472034 
#> 
#> Coefficients:
#>             Estimate Std. Error t value Pr(>|t|)   2.5 % 97.5 % Signif.
#> (Intercept)  -0.0354     0.0960 -0.3686   0.7132 -0.2261 0.1553        
#> V1           -0.0151     0.1062 -0.1418   0.8876 -0.2260 0.1959        
#> V2            0.1162     0.0983  1.1821   0.2401 -0.0790 0.3114        
#> V3            0.0185     0.1000  0.1847   0.8538 -0.1800 0.2169        
#> V4           -0.0660     0.0907 -0.7281   0.4683 -0.2461 0.1140        
#> V5            0.1089     0.0979  1.1126   0.2687 -0.0854 0.3032        
#> 
#> Residual standard error: 0.9341 on 94 degrees of freedom
#> Multiple R-squared: 0.0599 , Adjusted R-squared: 0.0099 
#> F-statistic: 1.1976 on 5 and 94 DF, p-value: 0.3164 
#> AIC: -7.8264 , BIC: 7.8046 , Deviance: 82.0153 
#> ===================================================================