MULTIPLE LINEAR REGRESSION - 5 Predictors

1 回表示 (過去 30 日間)
Priya
Priya 2013 年 7 月 19 日
I wish to perform multiple linear regression of 5 - 6 predictors (X) at a time.
I have total no. of 50 predictors.
I want to find regression coefficients for all possible combinations of predictors from the master dataset of 50 predictors taking 5 and 6 predictors at a time.
Y = a.X1 + b.X2 + c.X3 + d.X4 + e.X5 + f (5 predictors) Y = a.X1 + b.X2 + c.X3 + d.X4 + e.X5 + f.X6 + g (6 predictors)
I also want to find out the correlation coefficient between original Y and predicted Y after multiple Linear Regression.
  3 件のコメント
Priya
Priya 2013 年 7 月 23 日
Thanks a lot for your guidance. Suppose I have to make 3 combinations of 5 properties:
x = {A,B,C,D,E} % array of total 5 property data
So I am running 3 "for" loops:
for i = 1 : size(x,1)
for j = i : size(x,1)
for k = j : size(x,1)
and then i used regress function. It takes a lot of time. Is there any other fast approach to try such combinations without using any for loop..
dpb
dpb 2013 年 7 月 23 日
Well, you could try things like ndgrid and/or arrayfun ('uniformoutput','false' will be required) but I'd hold out little hope would save any great amount of time...
If you didn't preallocate for the results, doing that will make a noticeable improvement in the loop construct formulation. I'd not expect the for...end itself here to be the real time problem but simply the amount of "stuff" you're doing in sheer numbers.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by