For each fund calculate cumulative monthly return from


Problem - Before proceeding with Problem 1 read Christopher Baum's lecture titled "A little bit of Stata programming goes a long way..."  It covers loops, macros, and other constructs presented in Stata Primer Lecture #3, as well as some other topics. I would suggest starting your work on the problem well before the due date.

Place all commands in a do file. As always, be sure to print out and hand in your do file and the resulting log file. 

Part 1: Use mutual fund performance dataset: PerformanceAF636.dta to answer questions in part 1.

a. Generate numeric month variable and use monthly format for the numeric month variable.

b. For each fund calculate cumulative monthly return from first observation available to the last observation available. Cumulate returns by adding them up. You must use appropriate egen function and foreach loop to accomplish this task.

c. Which fund had the best and which fund had the worst cumulative performance over time? You must use a set of Stata commands to answer this question. The answer should be displayed in your log file.

d. Now calculate monthly returns for S&P500. Use formula

RetS&P500,t = (S&P500t/S&P500t-1) - 1

to calculate monthly return for S&P500. Also note that the fund returns are reported as percent returns. Re-scale returns for each fund so that they are in decimal form. You must use foreach loop to re-scale fund returns.

e. Run a regression of performance (in decimal form) on S&P500 return for each fund. Use for each loop to accomplish this task. Make sure that prior to running each regression you display a message stating "This is a regression of PerformanceXXXX on S&P500 return". The statement should be different for each regression because the value of XXXX is fund ID and thus will depend on the fund. Which fund has the greatest coefficient (in absolute value) on S&P500 return?

f. Now reshape the dataset from wide to long form so that instead of multiple Performance variables you have only one Performance variable over time. This will also create a new variable identifying each fund.

Part 2: In this part you will analyze company financials using Compustat data. Use compustat_data.dta to answers questions in part 2.

a. Convert company identifier (gvkey) from string to numeric variable.

b. Create another numeric variable that contains only the year of observation.

c. Generate new dataset of summary statistics that contains annual averages for total assets, cash, ebit and total liabilities and annual medians for the same financial variables.

d. Compare mean and median for each variable in part (c). Use appropriate Stata command. Comment on the relationship between the mean and the median for each variable. You must use a local macro, for each loop, and an appropriate Stata command to accomplish this task.

Assignment Files -

https://www.dropbox.com/s/cwsck5p9kep5vor/Homework%20-%20Assignment%20Files.rar?dl=0

Request for Solution File

Ask an Expert for Answer!!
Applied Statistics: For each fund calculate cumulative monthly return from
Reference No:- TGS02508778

Expected delivery within 24 Hours