Stepwisefit regression - additional outputs?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I am trying to code a series of regression analyses that uses a 'moving window', for example, 100 data points, where a stepwise regression is performed, then it moves on one step and repeats. For instance regression 1 would use data points 1:100, regression 2 uses 2:101 and so on. I think I can get this to work fine.
However, the output I get from each regression is the coefficient for each input variable (which is great) BUT I would also ideally get an output for what the intercept would be in each case too.
I have looked through the help but have not been able to find an option to request additional output data using stepwisefit (and I have way too much data to do each one manually with the stepwise function).
*****As always, once you ask a question you find new potential answers... Would a better method be to use a series of "betahat = regress" commands as (I think!) this gives you the intercept as well as all the coeff for the variable...?
Any advice would be greatly appreciated.
Best wishes Niall
댓글 수: 1
답변 (1개)
Tom Lane
2012년 2월 27일
The fifth output from the function is a structure having a .intercept field that contains the intercept for the final model.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!