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 件のコメント
Laurens Bakker
2012 年 2 月 27 日
Could you give us some more details on which functions you were using?
回答 (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!