Professional Documents
Culture Documents
***************************PART A******************************************/
*Create two temporary data sets that contain the original data in the
text files Data1.txt and Data2.txt;
*system options for page appearance;
***************************PART B*************************************;
/*Print output*/
proc print data=MyLib.MergedData Width=FULL label;
title 'Merged Data Set';
*show date and not #observations;
id date;
var dow bp--sf;
run;
******************************END OF PART B D
&E****************************;
***********************************PART
C*************************************;
data MyLib.LogResult (drop=bp cd dm jy sf
zbp zcd zdm zjy zsf);
set MyLib.MergedData;
zbp = bp / (lag(bp)) ;
zcd = cd / (lag(cd)) ;
zdm = dm / (lag(dm)) ;
zjy = jy / (lag(jy)) ;
zsf = sf / (lag(sf)) ;
*Calculate the log of daily returns(PART C);
lgbp = log(zbp);
lgcd = log(zcd);
lgdm = log(zdm);
lgjy = log(zjy);
lgsf = log(zsf);
*Volatility PART C;
*******************************PART F**************************************;
if _n_=1 then do;*do loop to establish report headings and column spacings;
* report headings;
put 'SAS X405, UCBX, November 2009, Term Project';
put 'Phil Duhe';
put ' ';
put 'Natural Logarithm of Daily Returns';
put 'of Five Currencies';
put 'June, 1973 to November, 1987';
put ' ';
put ' ';
put ' ';
put ' '
' British'
' Deutsche'
' Canadian'
' Japanese'
' Swiss'
;
put ' '
' Pounds'
' Marks'
' Dollars'
' Yen'
' Franc'
;
put ' ';
put ' Date'
' LGBP'
' LGCD'
' LGDM'
' LGJY'
' LGSF'
;
put ' - ';
********************************PART
G***************************************;
************************************PART
H***********************************;
**************************************PART I******************************;
**************************************PART J*******************************;
/*Calculate the skewness, kurtosis of the log of daily return of all the
random variables*/
****************OPTIONAL************************************************;
/*EXERCISE K*/
/*Write a macro program so that you can repeatedly excecute correlation
coefficients for different data sets without retyping the procedure*/
run;
%end;
%mend example;
***********************************************************************;
*Example of Calling MACRO Example;
***********************************************************************;
/*Extra Programs*/
********************************************************************;
ods html;
ods graphics on;
proc corr data=MyLib.LogResult nomiss noprint
plots=scatter(alpha = .20 .30);
var lgbp--lgsf;
run;
ods graphics off;
ods html close;