| Title: | S-Type Ridge Regression |
|---|---|
| Description: | Implements S-type ridge regression, a robust and multicollinearity-aware linear regression estimator that combines S-type robust weighting (via the 'Stype.est' package) with ridge penalization; automatically selects the ridge parameter using the 'ridgregextra' approach targeting a close to 1 variance inflation factor (VIF), and returns comprehensive outputs (coefficients, fitted values, residuals, mean squared error (MSE), etc.) with an easy x/y interface and optional user-supplied weights. See Sazak and Mutlu (2021) <doi:10.1080/03610918.2021.1928196>, Karadag et al. (2023) <https://CRAN.R-project.org/package=ridgregextra> and Sazak et al. (2025) <https://CRAN.R-project.org/package=Stype.est>. |
| Authors: | Filiz Karadag [cre] (ORCID: <https://orcid.org/0000-0002-0116-7772>), HakanSavas Sazak [aut] (ORCID: <https://orcid.org/0000-0001-6123-1214>), Olgun Aydin [aut] (ORCID: <https://orcid.org/0000-0002-7090-0931>) |
| Maintainer: | Filiz Karadag <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-13 07:30:07 UTC |
| Source: | https://github.com/filizkrdg/styperidge.reg |
Full regression results using the S-type robust ridge regression estimators
regstyperidge(x, y)regstyperidge(x, y)
x |
Explanatory variables (data.frame, matrix) |
y |
Dependent variables (data.frame, vector) |
A list of lists
library("mctest") x <- Hald[,-1] y <- Hald[,1] regstyperidge(x,y) library(isdals) data(bodyfat) x <- bodyfat[,-1] y <- bodyfat[,1] regstyperidge(x,y)library("mctest") x <- Hald[,-1] y <- Hald[,1] regstyperidge(x,y) library(isdals) data(bodyfat) x <- bodyfat[,-1] y <- bodyfat[,1] regstyperidge(x,y)
Fits a ridge regression model with observation-specific weights. The weights
can be supplied as a vector, data frame, or a square weight matrix. If a
vector or data frame is supplied, it is internally converted to a diagonal
weight matrix.
In the example below, the weight vector W is generated from a
Uniform(0, 1) distribution purely to illustrate how to call the function.
In practice, users should provide weights that reflect the structure of
their data.
Weightedridge.reg(x, y, W)Weightedridge.reg(x, y, W)
x |
Explanatory variables. A data.frame or matrix with observations in rows and predictors in columns. |
y |
Dependent variable. A numeric vector, data.frame, or matrix. For a
univariate response, this should be a length- |
W |
Observation weights. Can be
If |
A list with the following components:
Numeric scalar. The selected ridge parameter k.
Numeric matrix (p x 1). Ridge regression coefficients on the standardized scale (no intercept).
Numeric matrix ((p+1) x 1). Coefficients on the original (unstandardized) scale, including the intercept in the first row.
Numeric matrix (n x 1). Residuals on the standardized scale (yr - yhat).
Numeric matrix (n x 1). Weighted residuals (W^(1/2) %*% e).
Numeric matrix (n x 1). Fitted values on the standardized scale (xr %*% beta).
Numeric matrix (n x 1). Fitted values in the weighted standardized space (xrw %*% beta).
Numeric matrix (n x 1). Fitted values on the original scale using betaor.
Numeric scalar. Mean squared error (MSE) computed from weighted residuals.
Numeric scalar. Overall model F statistic based on the weighted ANOVA decomposition.
Numeric scalar. P-value associated with F.
Numeric matrix (p x p). Estimated covariance matrix of beta on the standardized scale.
Numeric vector (length p). Standard errors of beta.
Numeric scalar. Weighted coefficient of determination (R-squared).
Numeric scalar. Adjusted weighted R-squared.
A data.frame. ANOVA-style table with sums of squares, degrees of freedom, mean squares, F, and p-value.
Numeric matrix (2 x p). Confidence intervals for beta; first row is lower, second row is upper.
## Example: Weighted ridge regression using the bodyfat data from isdals library(isdals) data(bodyfat) ## Explanatory variables (x) and response (y) x <- bodyfat[ , -1] # all columns except the first: predictors y <- bodyfat[ , 1] # first column: response (body fat percentage) ## Generate observation weights uniformly on [0, 1] n <- nrow(x) W <- runif(n, min = 0, max = 1) ## Fit the weighted ridge regression model fit <- Weightedridge.reg(x, y, W) ## Inspect some key outputs fit$beta # coefficients in the standardized scale fit$betaor # coefficients in the original scale (including intercept) fit$R2 # R-squared fit$R2adj # Adjusted R-squared fit$anovatable # ANOVA table## Example: Weighted ridge regression using the bodyfat data from isdals library(isdals) data(bodyfat) ## Explanatory variables (x) and response (y) x <- bodyfat[ , -1] # all columns except the first: predictors y <- bodyfat[ , 1] # first column: response (body fat percentage) ## Generate observation weights uniformly on [0, 1] n <- nrow(x) W <- runif(n, min = 0, max = 1) ## Fit the weighted ridge regression model fit <- Weightedridge.reg(x, y, W) ## Inspect some key outputs fit$beta # coefficients in the standardized scale fit$betaor # coefficients in the original scale (including intercept) fit$R2 # R-squared fit$R2adj # Adjusted R-squared fit$anovatable # ANOVA table