Looping Regression Analysis using VBA

Crypsis

New Member
Joined
May 8, 2018
Messages
5
Dear All,

Thanks for reading. I am wondering if anyone could help me write a macro in order to loop the regression function.

I have a total of 56 dependent variables and 3 independent variables which remain constant for all the regressions. Every regression is just using the next column for the dependent variable up to column BE. Here is what i have so far:

Code:
Sub Regression()'
' Regression Macro
'


'
     Application.Run "ATPVBAEN.XLAM!Regress", ActiveSheet.Range("$B$1:$B$166"), _
        ActiveSheet.Range("$BG$1:$BI$166"), False, True, , "", False, False, _
        False, False, , False
    Sheets("Data").Select
End Sub

This macro doesn't work at all but may give some idea of where i am getting to.

So the data for each dependent variable is stored from row 1 to 166 and from column B to column BE where it ends.

At the moment i am storing each regression on a new worksheet but ideally it would be great to store it in an array or table. If anyone has any better ideas then please do share!

Look forward to hearing your suggestions.

Thanks very much!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top