regstats
Regression diagnostic statistics.
📝Syntax
stats = regstats(y, X)
stats = regstats(y, X, modelspec)
stats = regstats(y, X, modelspec, StatNames)
📄Description

regstats fits a linear regression model of response vector y on predictor matrix X and returns diagnostic statistics in a structure.

The model includes a constant term by default. Supported model specifications are linear, additive, interactions, quadratic, purequadratic, a positive integer degree, or a numeric matrix of term exponents.

StatNames can be all, a text scalar, or a cell array of names. Supported statistic names include Q, R, beta, covb, yhat, r, mse, rsquare, adjrsquare, leverage, hatmat, s2_i, beta_i, standres, studres, dfbetas, dffit, dffits, covratio, cookd, tstat, fstat, and dwstat.

💡Examples
X = [1 5; 2 4; 3 6; 4 8; 5 7; 6 9];
y = [3.2; 4.1; 5.9; 7.8; 8.4; 10.2];
stats = regstats(y, X, 'linear', {'beta', 'rsquare', 'tstat'})
X = [1 5; 2 4; 3 6; 4 8; 5 7; 6 9];
y = [3.2; 4.1; 5.9; 7.8; 8.4; 10.2];
stats = regstats(y, X, 'interactions', {'yhat', 'r'})
🔗See Also
regressrobustfitridgelasso
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub