regress
Multiple linear regression
Syntax
Description
Examples
Input Arguments
Output Arguments
Tips
Algorithms
Alternative Functionality
regress
is useful when you simply need the output arguments of
the function and when you want to repeat fitting a model multiple times in a loop. If
you need to investigate a fitted regression model further, create a linear regression
model object LinearModel
by using fitlm
or stepwiselm
. A LinearModel
object provides more features than regress
.
Use the properties of
LinearModel
to investigate a fitted linear regression model. The object properties include information about coefficient estimates, summary statistics, fitting method, and input data.Use the object functions of
LinearModel
to predict responses and to modify, evaluate, and visualize the linear regression model.Unlike
regress
, thefitlm
function does not require a column of ones in the input data. A model created byfitlm
always includes an intercept term unless you specify not to include it by using the'Intercept'
name-value pair argument.You can find the information in the output of
regress
using the properties and object functions ofLinearModel
.Output of regress
Equivalent Values in LinearModel
b
See the Estimate
column of theCoefficients
property.bint
Use the coefCI
function.r
See the Raw
column of theResiduals
property.rint
Not supported. Instead, use studentized residuals ( Residuals
property) and observation diagnostics (Diagnostics
property) to find outliers.stats
See the model display in the Command Window. You can find the statistics in the model properties ( MSE
andRsquared
) and by using theanova
function.
References
[1] Chatterjee, S., and A. S. Hadi. “Influential Observations, High Leverage Points, and Outliers in Linear Regression.” Statistical Science. Vol. 1, 1986, pp. 379–416.
Extended Capabilities
Version History
Introduced before R2006a
See Also
LinearModel
| fitlm
| stepwiselm
| mvregress
| rcoplot