Long regression calculations crashing
Posted: 22 November 2014 12:44 PM   [ Ignore ]
Newbie
Rank
Total Posts:  7
Joined  2014-10-14

Hi all,

I am tyring to find the CAPM beta through regression of returns vs. market returns (Fama & French data) for around 3,000 CUSIPs (firms). The regression works, however my code never runs through until the final CUSIP because of various errors such as connection losses / general hang-ups. The error log shows:

{“statusText”:“Proxy Error”,“status”:502,“responseURL”:“http://192.168.57.128/SASStudio/sasexec/sessions/d257d008-6bf7-41a5-9a42-2be957287224/submissions?label=20141116+Calculate_alpha_beta.sas&uri;=/folders/myshortcuts/MR/WIP/20141116+Calculate_alpha_beta.sas&pdf=true&rtf=true”,“response”:”\n\n\n\n
Proxy Error

\n
The proxy server received an invalid\r\nresponse from an upstream server.
\r\nThe proxy server could not handle the request POST /SASStudio/sasexec/sessions/d257d008-6bf7-41a5-9a42-2be957287224/submissions.
\nReason: Error reading from remote server
\n
\n
Apache vFabric Server at 192.168.57.128 Port 80
\n\n”,“responseType”:”“,“responseXML”:null,“responseText”:”\n\n\n\n
Proxy Error

\n
The proxy server received an invalid\r\nresponse from an upstream server.
\r\nThe proxy server could not handle the request POST /SASStudio/sasexec/sessions/d257d008-6bf7-41a5-9a42-2be957287224/submissions.
\nReason: Error reading from remote server
\n
\n
Apache vFabric Server at 192.168.57.128 Port 80
\n\n”,“upload”:{“ontimeout”:null,“onprogress”:null,“onloadstart”:null,“onloadend”:null,“onload”:null,“onerror”:null,“onabort”:null},“withCredentials”:false,“readyState”:4,“timeout”:0,“onreadystatechange”:null,“ontimeout”:null,“onprogress”:null,“onloadstart”:null,“onloadend”:null,“onload”:null,“onerror”:null,“onabort”:null}
[TRACEBACK]

at null. (http://192.168.57.128/SASStudio/resources/js/webdms/DMSEditor.js:4848:21)
at Object.error (http://192.168.57.128/SASStudio/resources/js/dojo/dojo/_base/lang.js:375:55)
at http://192.168.57.128/SASStudio/resources/js/dojo/dojo/_base/xhr.js:386:16
at notify (http://192.168.57.128/SASStudio/resources/js/dojo/dojo/_base/Deferred.js:187:23)
at complete (http://192.168.57.128/SASStudio/resources/js/dojo/dojo/_base/Deferred.js:168:4)
at reject.errback (http://192.168.57.128/SASStudio/resources/js/dojo/dojo/_base/Deferred.js:263:4)
at notify (http://192.168.57.128/SASStudio/resources/js/dojo/dojo/_base/Deferred.js:202:25)
at complete (http://192.168.57.128/SASStudio/resources/js/dojo/dojo/_base/Deferred.js:168:4)

Hence, I am left with the CUSIPs for only a number of firms. Any idea on how to stop the execution from crashing? Perhaps something like executing the code in parts? First 500 firms, next 500 firms, etc.? See below for my (very simple) code:

proc reg data=WIP.Returns_FF_ab outest=WIP.Regression_output;
by targetCUSIP;
model ret_minus_rf RmRf;
run


Cheers,

Arthur

Profile
 
 
Posted: 22 November 2014 12:46 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Arthur,

Are you running this on WRDS or somewhere else?

One way to get around it is to download the csrp datasets to your machine and run it locally.

If you are using WRDS, you could use SSH and run the code on their server.

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 22 November 2014 12:53 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  7
Joined  2014-10-14

Hi Joost,

I am running a VMware virtual machine with SAS University Edition on my own computer and have the CRSP database downloaded to my hard drive for the relevant timeframe. The dataset “WIP.Returns_FF_AB” contains (for each CUSIP) the returns from CRSP for 36 months (RET) and the according Rf and Rm from Fama & French factor data for each datadate.

What do you think causes the error?

Profile
 
 
Posted: 22 November 2014 01:01 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Arhur,

I haven’t used SAS within a VM framework. Is there a way around it, like having SAS installed on your pc ‘normally’? 3,000 regressions isn’t a heavy load. Do other tasks (like proc means, etc) behave normally?

best,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile
 
 
Posted: 22 November 2014 01:33 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  7
Joined  2014-10-14

Hi Joost,

Sometimes the solution lies in an unexpected place: I simply added a “NOPRINT” to the proc reg command and now the entire calculation (up to the last CUSIP) finishes in seconds, so problem solved! I think the printing the output somehow really slows the process down to the point where it crashes.

Thanks for your help,

Arthur

Profile
 
 
Posted: 22 November 2014 02:00 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Arthur,

Glad you found the culprit!

best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile