ROE example
Posted: 06 September 2012 09:27 PM   [ Ignore ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

Joost,

for the ROE example, could you please post your code to draw the fancy picture at the end of the example please?

Thanks!

P.S. A small bug of this code, not really a problem: we don’t need to keep ROE on the wrds server, since the rest of the code will calculate it later on after download.

 Signature 

Zenghui
A humble student of business

Profile
 
 
Posted: 07 September 2012 01:47 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi Zenghui,

The graphs are made with gle (open source software), see gle-graphics.org.

I first create the data needed in SAS and export it in csv format (googlemtb.dat), to be used as inputs in the gle script.

Gle can export the graph as a pdf, which can then be imported in a word document or Latex. For this to work, you will need to install ‘Ghostscript’, which is somewhat painful (on Windows). It doesn’t seem very stable because I had to reinstall it more than once. On linux, this seems easier/more stable.

The code for ROA is as follows (use d1 and d3 for MTB):

include "graphutil.gle"

size 15 8

sub graph_hairlines
   set lstyle 6 just lc
  
graph_vline f0
 
!  graph_text f0 15000 label "f_0" dx 0.1
  set lstyle 1 color grey
   graph_hline 0
end sub

!file contents
!fyear,mtb_google,roa_google,mtb_industry,roa_industry
!2004,17.568434482,0.1204578084,2.3922329523,-0.020013697

set font texcmr
begin graph
   
   xtitle 
"Firm year"
  
   
ytitle "Return on Assets (ROA)"
   
   
xticks on
   
   data   
"googlemtb.dat"
   
   
d2 key "Google"
   
d4 key "Industry (SIC 7370)"
   
bar d2,d4 fill navy,skyblue
     
   key pos br 
   under graph_hairlines

end graph 

The graphutil.gle file (which is imported) includes some routines, see attached.

best regards,

Joost

File Attachments
graphutil.zip  (File Size: 2KB - Downloads: 447)
 Signature 

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

Profile
 
 
Posted: 07 September 2012 07:01 AM   [ Ignore ]   [ # 2 ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

wow

That is a lot of cool work

Thanks for sharing!

 Signature 

Zenghui
A humble student of business

Profile
 
 
Posted: 07 September 2012 08:47 AM   [ Ignore ]   [ # 3 ]
Sr. Member
RankRankRankRank
Total Posts:  169
Joined  2011-09-20

It seems using myexport macro to output csv , then use excel to draw pictures are also quick.
not as professional as your method.

smile

 Signature 

Zenghui
A humble student of business

Profile