（股票代号“ ^ GSPC”）。
1个

x打开Stata并通过选择文件Æ导入ÆExcel电子表格并选择

x运行“ gen数据集= 1”，然后运行“ xtset数据集date_num”告诉Stata您具有面板数据。
x为每只股票和标准普尔500生成回报变量。
x为每只股票创建具有线性预测线的市场收益与收益的散点图。
x将每只股票的收益与市场进行回归。
x在表中记录每只股票的R平方，常数和beta。

In this lab, you will use the CAPM model to predict the expected rate of return for two publicly traded
US firms.
Part 1: Pick Two Companies
Choose two companies that meet the following requirements. 1) They are both part of the S&P 500. 2)
They have been publicly traded for at least five years. You can find a list of companies currently part of
the S&P 500 here: https://en.wikipedia.org/wiki/List_of_S%26P_500_companies.
Using Yahoo! Finance (yahoo.finance.com), download five years of historical monthly adjusted price
data for both companies. Also download five years of monthly adjusted price data for the S&P 500
(ticker “^GSPC”).
1
Put the data together in a single excel spreadsheet with a unified date variable that
ranges from 1 to 60 (March 1, 2021). Label each column. Label the date variable “date_num”.
Part 3: Graphical and Regression Beta Analysis
x Open Stata and load the data by selecting File Æ Import Æ Excel Spreadsheet and selecting the
option treat first row as variable names.
x Run “gen dataset = 1” then “xtset dataset date_num” tell Stata that you have panel data.
x Generate a return variable for each stock and for the S&P 500.
x Create a scatterplot of returns against market returns with linear predicted line for each stock.
x Regress the return for each stock against the market.
x Record R-squared, the constant, and beta for each stock in a table.
Part 4: Beta Analysis
Which firm had a higher beta? Based on our discussion of the determinants of beta, does this surprise
you? Why or why not?
Part 5: Jensen’s Alpha Analysis
Calculate Jensen’s Alpha for each firm. The units on your Jensen’s Alpha should be annualized percent
return. Which stock had a higher Jensen’s Alpha? Relying on news articles over the past five years, does
this surprise you? Why or why not?