Statistics Toolbox    
regress

Multiple linear regression

Syntax

Description

b = regress(y,X) returns the least squares fit of y on X by solving the linear model

for , where:

[b,bint,r,rint,stats] = regress(y,X) returns an estimate of in b, a 95% confidence interval for in the p-by-2 vector bint. The residuals are returned in r and a 95% confidence interval for each residual is returned in the n-by-2 vector rint. The vector stats contains the R2 statistic along with the F and p values for the regression.

[b,bint,r,rint,stats] = regress(y,X,alpha) gives 100(1-alpha)% confidence intervals for bint and rint. For example, alpha = 0.2 gives 80% confidence intervals.

Examples

Suppose the true model is

where I is the identity matrix.

Compare b to [10 1]'. Note that bint includes the true model values.

Reference

[1]  Chatterjee, S. and A. S. Hadi. Influential Observations, High Leverage Points, and Outliers in Linear Regression. Statistical Science, 1986. pp. 379- 416.


  refline regstats