title 'ppseps.sas: PPS and EPS, 10 firms, p 335'; options linesize=90; |
Specifies the title listed on the top of each page of output. Each page is limited to a width of 90 columns. |
ods html4 path="~/public_html" file="ppseps.html"; | Invoke the Output Delivery System (ODS) so that in addition to the standard output listing file (.lst) of text, also direct this text output to the html (text) file ppseps.html. The path to this file locates the file in the top-level of the user's web site. If running this program at PSU, point a browser to web.pdx.edu/~userid/ppseps.html. |
|
Data Preparation and Display |
data ppseps; infile "ppseps.csv" dsd dlm=","; length firm$ 23; input firm$ eps pps; |
This data step creates the SAS data set called ppseps. Read three variables from the comma delimited data file, ppseps.csv, created by MS Excel. The first variable, firm, is a character variable, indicated by the $. The default length of character variables is only 8 characters, so allow for up to 23 characters. Here are the first two lines of data from ppseps.csv:
Imo Industries Inc,-3.26,6.5 Toro Co,-1.98,13 |
proc print data=ppseps; format eps pps dollar8.2; |
List the data. Add the dollar sign and the decimal point to the data in this listing, allowing for 8 total characters each value, two digits to the right of the decimal point. |
|
Core Analyses |
proc corr data=ppseps; vars pps eps; |
Calculate the correlation matrix of pps and eps. |
proc reg data=ppseps; model pps = eps / clb; |
Regress pps onto eps and calculate the corresponding confidence intervals of the regression coefficients (b's), requested by the clb option. |
|
Hi-Resolution Graphics |
filename gfile 'ppseps.pdf'; goptions device=pdfc gsfmode=replace gsfname=gfile; |
Direct subsequent hi-resolution graphics to a color pdf file (pdfc) called ppseps.pdf. Replace any existing copy of ppseps.pdf. |
symbol interpol=rl value=dot cv=red ci=blue width=5; | When Proc Gplot is run, plot the regression line (rl) through the scatterplot. Use a red dot for each point in the scatterplot, set the regression line to blue and set the width larger than the default of 1. |
proc gplot data=ppseps; plot pps * eps; title 'Regression for PPS and EPS'; |
Use gplot (graphics plot) to create a high-resolution graphics scatterplot of pps with eps plus the regression line. Specify a new title for the graph. The goptions and filename statements above direct this output to a pdf file. The ODS statement above also directs this output to a gif file placed on the user's web site. |