Where is the intercept in regress

13 views (last 30 days)
Nuchto
Nuchto on 7 Jun 2013
When you use the "regress" function, where is the intercept?

Accepted Answer

ARS
ARS on 7 Jun 2013
Hi,
In my limited knowledge, you will have to include a very first column of 'ones' in the independent variables side(matrix). Then use regress function and the very first beta coefficient will be the intercept.
An example is available here:
click on 'Regress' on the page and you will notice "ones" function:
  • X = [ ones(N,1) airqual(:,[18 19 20]) sin(Wd) cos(Wd) airqual(:,22)]*
Hope it helps.
Thanks.
  2 Comments
Nuchto
Nuchto on 7 Jun 2013
That makes perfect sense, thanks!
ARS
ARS on 7 Jun 2013
Please "accept" the answer if it works fine.
Thanks.

Sign in to comment.

More Answers (0)

Categories

Find more on Linear and Nonlinear Regression in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!