This exercise will estimate and test some hypotheses about the CAPM beta for several US stocks. First, Open a new workfile to accommodate monthly data commencing in January 2002 and ending in April 2007. Then import the Excel file 'capm.xls'. The file is organised by observation and contains six columns of numbers plus the dates in the first column, so in the 'Names for series or Number if named in file' box, type 6. As before, do not import the dates so the data start in cell B2. The monthly stock prices of four companies (Ford, General Motors, Microsoft and Sun) will appear as objects, along with index values for the S&P500 ('sandp') and three-month US-Treasury bills ('ustb3m'). Save the EViews workfile as 'capm.wk1'.
In order to estimate a CAPM equation for the Ford stock, for example, we need to first transform the price series into returns and then the excess returns over the risk free rate. To transform the series, click on the Generate button (Genr) in the workfile window. In the new window, type
This will create a new series named RSANDP that will contain the returns of the S&P500. The operator (-1) is used to instruct EViews to use the one-period lagged observation of the series. To estimate percentage returns on the Ford stock, press the Genr button again and type
This will yield a new series named RFORD that will contain the returns of the Ford stock. EViews allows various kinds of transformations to the series. For example
creates a new variable called X2 that is half of X
creates a new variable XSQ that is X squared creates a new variable LX that is the log of X
creates a new variable LAGX containing X
lagged by one period LAGX2=X(-2) creates a new variable LAGX2 containing X lagged by two periods
Other functions include:
If, in the transformation, the new series is given the same name as the old series, then the old series will be overwritten. Note that the returns for the S&P index could have been constructed using a simpler command in the 'Genr' window such as
as we used in chapter 1. Before we can transform the returns into excess returns, we need to be slightly careful because the stock returns are monthly, but the Treasury bill yields are annualised. We could run the whole analysis using monthly data or using annualised data and it should not matter which we use, but the two series must be measured consistently. So, to turn the T-bill yields into monthly figures and to write over the original series, press the Genr button again and type
Now, to compute the excess returns, click Genr again and type ERSANDP=RSANDP-USTB3M
where 'ERSANDP' will be used to denote the excess returns, so that the original raw returns series will remain in the workfile. The Ford returns can similarly be transformed into a set of excess returns.
Now that the excess returns have been obtained for the two series, before running the regression, plot the data to examine visually whether d(X) first difference of X
d(X,n) nth order difference of X
dlog(X) first difference of the logarithm of X
dlog(X,n) nth order difference of the logarithm of X
abs(X) absolute value of X
the series appear to move together. To do this, create a new object by clicking on the Object/New Object menu on the menu bar. Select Graph, provide a name (call the graph Graph1) and then in the new window provide the names of the series to plot. In this new window, type
Was this article helpful?
We Are Not To Be Held Responsible If Your Online Trading Profits Start To Skyrocket. Always Been Interested In Online Trading? But Super-Confused And Not Sure Where To Even Start? Fret Not! Learning It Is A Cakewalk, Only If You Have The Right Guidance.