Historic EPS, PE and revenues

Category : Uncategorized

Historic EPS, PE and revenues

Please make sure you have the most updated mfd_dm, mfd_ta and mfd_tex packages for Stata installed for this post.

*
net from "http://www.researchforprofit.com/stata/mfd_dm"
net from "http://www.researchforprofit.com/stata/mfd_ta"
net from "http://www.researchforprofit.com/stata/mfd_tex"
* click on the blue mfd_dm package and then "click here to install" 
*

Historical earnings per share (EPS), revenues and price to earnings ratio (PE).

Data WITHOUT “annual” and “pe” options:

*
clear all
cd "/Users/mfd/Desktop"

mfd_dm_EPS AAPL GOOG MSFT IBM, item(eps)

mfd_dm_EPS AAPL GOOG MSFT IBM, item(eps) annual pe


mfd_dm_EPS AAPL GOOG MSFT IBM, item(revenue) annual pe
*

Screen Shot 2013-10-12 at 4.18.40 PM

Data WITH “annual” and “pe” options:

Screen Shot 2013-12-28 at 1.28.18 PM

Historic EPS for all Dow Jones 30 companies: 

*
clear all
cd "/Users/mfd/Desktop"

* Get the components of DJI Index
mfd_dm_components, symbol(^DJI)
drop if Symbol==""
sort Symbol
levelsof Symbol, local(tickers)

mfd_dm_EPS `tickers', item(eps) annual pe

keep if _n==_N
keep PE_*_annual
xpose, clear varname
sort v1
*

Historic PE, multiple companies:

*
clear all
cd "/Users/mfd/Desktop"

mfd_dm_EPS AAPL GOOG MSFT IBM, item(eps) annual pe

tsline PE_IBM_annual PE_MSFT_annual PE_GOOG_annual PE_AAPL_annual if year(date)>2010, ylabel(#20, angle(horizontal) axis(1)) xlabel(#20, angle(vertical)) scale(.70) legend(on cols(5)) 
*

PE_all

EPS and PE along with Apple events on a chart: 

*
clear all
cd "/Users/mfd/Desktop"

mfd_dm_EPS AAPL, item(eps) annual pe

gen iPhone=.
foreach aa in "29jun2007" "11jul2008" "19jun2009" "24jun2010" "14oct2011" "21sep2012" {
    replace iPhone=eps_AAPL_annual if date==date("`aa'","DMY")
}
gen iPad=.
* 3apr2010 is a weekend. Changed it to 5apr2010
foreach aa in "5apr2010" "11mar2011" "16mar2012" "2nov2012" {
	replace iPad=eps_AAPL_annual if date==date("`aa'","DMY")
}

twoway (line eps_AAPL_annual date) (scatter iPhone date, mcolor(red)) (scatter iPad date, mcolor(black)) if year(date)>2006, ylabel(#50, angle(horizontal) axis(1)) xlabel(#50, angle(vertical)) scale(.5) legend(on cols(5)) 
graph export "eps_aapl.png", replace
*

eps_aapl_annual

EPS (quarterly annualized) increase after each iPhone release: 

*
clear all
cd "/Users/mfd/Desktop"

mfd_dm_EPS AAPL, item(eps) annual pe

gen iPhone=.
foreach aa in "29jun2007" "11jul2008" "19jun2009" "24jun2010" "14oct2011" "21sep2012" {
    replace iPhone=eps_AAPL_annual if date==date("`aa'","DMY")
}
gen iPad=.
* 3apr2010 is a weekend. Changed it to 5apr2010
foreach aa in "5apr2010" "11mar2011" "16mar2012" "2nov2012" {
    replace iPad=eps_AAPL_annual if date==date("`aa'","DMY")
}

sort date
gen temp=1 if ((eps_AAPL!=eps_AAPL[_n-1]) | (iPhone!=.)) & (eps_AAPL[_n-1]!=.)
keep if temp==1

gen temp3=.
replace temp3=0 if iPhone!=.
replace temp3=1 if date-date[_n-1]>15 & iPhone[_n-1]!=.
replace temp3=1 if temp3[_n-1]==. & temp3[_n-2]==0
keep if temp3!=.

gen eps_ret=(eps_AAPL_annual[_n+1]-eps_AAPL_annual)/eps_AAPL_annual if (temp3==0)
keep date eps_AAPL_annual eps_ret
order date eps_AAPL_annual eps_ret
*

Screen Shot 2013-09-08 at 11.27.44 PM