(Experimental Design)
Write the Algorithm based on the following Experimental Design:
STEP 1: Read the data sets
Read Monthly stock prices (sas data set”bsemonthlyprices”) Jan 1990 to Mar 2007
Import monthly sensex prices (Closing Prices” Bse sensex monthly CP”) 1990 to 2007
STEP 2: Filter the Data
Filters to apply for bsemonthlyprices sas dataset.
If cp=0 then delete
If date < 1 Jan 1990 then delete
If Date > 31 Dec 2006 then delete
USE proc timeseries to convert both bsemonthlyprices and bsesensex to monthly series and align to the end.
STEP 3: Manipulate the Data and Compute Monthly Returns and Monthly Excess Returns
Merge the above two files and compute stock returns and sensex returns
Compute U (Excess returns over the Market) = stock returns – Market returns
STEP 4: Compute the yearly return for each stock per year for all the stocks.
Proc means; by year name;
STEP 5: Split the datasets into two parts compute the returns in evaluation and monitoring periods. Give proper codes so that we can merge them back.
Divide the returns dataset into two parts
If year in (1990 , 1992 , 1994 , 1996 ,….2006) then send it to eval dataset; Even years in eval dataset.
IF year in (1991 ,1993,1995 ,----2005) then send it to file called Monitor .
{Hint: you can use function : mod(year,2)= 0}
Have a counter(group) in each dataset for each year (1990 is 1, 1992 is 2 and so on)
What have we done, split the data into two parts evaluation period and monitoring period. Why have we done this. We pick winners and losers based on evaluation (period) returns and see how they perform in the monitoring period (returns).
Evaluation data set has data pertaining to the evaluation period
Rename the returns
Monitoring dataset has data pertaining to the monitoring period (one year after evaluation year). Rename the returns
STEP 6: Data to be merged so that for each stock and group(counter) we have returns in the