How to Run automatically regression to n-Dependent variables
Posted: Fri Feb 19, 2010 7:00 am
Dear all :? ,
I am a new member to this forum and not knowledgable at all about programming. I am just now starting to learn some basic commands. I have the following enquiry. I need to run a cross-sectional regression for a 4-factor model to daily data of 4380 dependent variables and for approximately 238 months and summarise betas montlhy. Overal, this will require something such as 1,000,000+ regressions. So, I am trying to do it with a script by reading and trying to understand the examples of this forum. I have created something but it is unfortunately not working. The programe is as follows:
____________________________________________________________________________
Matrix (4380,4380) results
scalar ncoeff
scalar KK = 0
For !Y = 1 to 4380
equation eq1.ls com{!Y} c rpr{!Y} smb{!Y} hml{!Y} wml{!Y}
ncoeff = arc1.@ncoefs
For !K = 1 to Ncoeff
results(KK+1,!K) = arc1.@coefs(!K)
results(KK+2,!K) = arc1.@tstats(!K)
Next
results(KK+1,11) = arc1.@aic
results(KK+1,12) = arc1.@rbar2
results(KK+1,13) = arc1.@Logl
results(KK+1,14) = arc1.@ssr
Next
KK = KK + 3
Next
Show results
__________________________________________________________________________________
Unfortunately, the above script is not working and I can't see why (as I mentioned earlier I am not any good at all with programming. Any help will be greatly appreciated. I am using eviews 6. So, all my 254+ columns spreadsheets are first saved as txt first (tab delimited) and then imported into eviews6.
PS.
I have also attached a sample of the spreadsheet in picture that I use as a pilot data source if any if you want to have a look on the data (this is only two calendar month, 121 and 122 calendar months). Also, can someone suggest a book for starting with programming....(something for people with NO PRIOR EXPERIENCE whatsoever in programming).
Many thanks for any feedback and comments
I am a new member to this forum and not knowledgable at all about programming. I am just now starting to learn some basic commands. I have the following enquiry. I need to run a cross-sectional regression for a 4-factor model to daily data of 4380 dependent variables and for approximately 238 months and summarise betas montlhy. Overal, this will require something such as 1,000,000+ regressions. So, I am trying to do it with a script by reading and trying to understand the examples of this forum. I have created something but it is unfortunately not working. The programe is as follows:
____________________________________________________________________________
Matrix (4380,4380) results
scalar ncoeff
scalar KK = 0
For !Y = 1 to 4380
equation eq1.ls com{!Y} c rpr{!Y} smb{!Y} hml{!Y} wml{!Y}
ncoeff = arc1.@ncoefs
For !K = 1 to Ncoeff
results(KK+1,!K) = arc1.@coefs(!K)
results(KK+2,!K) = arc1.@tstats(!K)
Next
results(KK+1,11) = arc1.@aic
results(KK+1,12) = arc1.@rbar2
results(KK+1,13) = arc1.@Logl
results(KK+1,14) = arc1.@ssr
Next
KK = KK + 3
Next
Show results
__________________________________________________________________________________
Unfortunately, the above script is not working and I can't see why (as I mentioned earlier I am not any good at all with programming. Any help will be greatly appreciated. I am using eviews 6. So, all my 254+ columns spreadsheets are first saved as txt first (tab delimited) and then imported into eviews6.
PS.
I have also attached a sample of the spreadsheet in picture that I use as a pilot data source if any if you want to have a look on the data (this is only two calendar month, 121 and 122 calendar months). Also, can someone suggest a book for starting with programming....(something for people with NO PRIOR EXPERIENCE whatsoever in programming).
Many thanks for any feedback and comments