Anda di halaman 1dari 12

Factor Analysis on Determinants of Stock Price & Returns with Python OLS Linear

Regression

Adrian Leung
Charles H. Lundquist College of Business
University of Oregon 2019
______________________________________________________________________________
Abstract: This study aims to conduct research and look at factors affecting stock prices and
returns for high-tech companies in Facebook, Amazon, Apple, Netflix, and Google (FAANG).
Starting with discussion on the dependent variables and how the stocks were chosen, as well as
describing the independent variables in Earnings Per Share (EPS), Debt to Equity (DER) ratio,
and Price to Book (PBR) ratio and their impacts on the stock prices and returns. The research
within the study is conducted with the assistance of powerful packages within Python that
efficiently calculate the necessary components of the study. Utilizing statistical analysis
methodologies we will describe our hypothesis and perform multivariable Ordinary Least
Square (OLS) regression, and conclude with our calculations, and interpretations of the results.
______________________________________________________________________________

I. Introduction
Firms in the United States have made large advances in their stock prices in the past decade following the
events of the recession in 2007-2009. This study aims to reexamine the relationship between earnings per
share, price to book, and debt to equity ratios on stock price and returns with the use of multi-variable
Ordinary Least Square regression. Decades of empirical research has been conducted about various
macro-economic variables and their effect on share price and returns, including GDP, confidence levels,
interest rates, and micro variables such as internal factors including firm-specific numbers such as
revenue, earnings, dividends, as well as ratios such as Earnings Per Share.

II. Literature Review


There have been many empirical studies conducted on the effects of certain micro-economic factors on
stock prices and returns on different industries and markets around the world. Collins (1957) has been
widely regarded as the pioneer in evaluation of factors on stock prices in the United States, where he
found earnings to have a strong correlation to US Banks. Almumani (2014) further confirmed this, when
he conducted a study following the great recession in 2008, to identify which of the micro-economic
determinant factors for stock prices in the Amman Stock Exchange in Jordan. His research found through
multiple linear regression analysis found that earnings per share, book value ratio, and price earnings ratio
had significant influence on bank stock prices in Jordan.
Another study by Utami, Widya Retno (2015) examined macro-economic and firm-specific ratios with
respect to the Indonesian construction sub-sector in the Indonesia Stock Exchange, finding that debt to
equity ratio, variable quick ratio, and price to earnings ratio and strong influence on their stock returns in
Indonesia. In looking at the effects of certain ratios on stock returns, Barbee (1996) found that stock to
price and debt to equity ratio had a significant positive relationship with stock returns. This study will
look to continue the research to identify if these factors remain significant in this time period.

III. Research Methodology

1. Tools/Python Code
The research will be utilizing powerful Python packages to collect the data, perform calculations, and
perform OLS regressions. The packages used include Pandas, NumPy, StatsModels, and MatPlotLib.
StatsModels, NumPy, and Pandas packages are powerful tools in data analysis, as well as performing the
calculations necessary such as logarithms as well as multivariable OLS regressions, and MatPlotLib will
be utilized to aid in visualization of the data. The python code scrapes the Adjusted Close Prices from
Yahoo Finance using Pandas DataReader from the beginning of 2009 until 2019 for the stocks chosen.
Next it calculates the daily returns, as well as the log of the returns and prices. The factors are imported in
using Pandas (read_csv) which we then calculate the log of the factors and join the respective data frames
for our regressions. Using StatsModels, we can then perform OLS regressions for each stock individually
with respect to their EPS, DER, and PBR.

2. Data/ Variables
The companies chosen were in the technology industry, with the stocks chosen to be FAANG stocks in
Facebook, Amazon, Apple, Netflix, and Google. The data was drawn utilizing Python’s Pandas library to
scrape the Adjusted Close numbers for each stock from Yahoo Finance. From there, we could place them
into Data Frames to then perform our calculations and regressions. Data for the independent variables
Earnings Per Share, Debt to Equity Ratios, and Price to Book ratios were collected from Wharton
Research Data Service (WRDS). It is important to note that Facebook went public on May 18th, 2012,
which with quarterly data only allowed limited data to conduct regression analysis to 29 observations for
Facebook.

The dependent variables will be the stock prices and returns for each of the stocks mentioned above. The
independent variables used are firm-specific ratios Earnings Per Share, Debt to Equity Ratio, and Price to
Book Ratio values. As these values are reported quarterly, our data will reflect quarterly changes. To look
at the effects of multicollinearity, a correlation coefficient matrix (Table 3) can be examined to identify if
there are any variables with strong correlations.
𝜸 = 𝜶 + 𝜷𝟏 𝑬𝑷𝑺𝟏 + 𝜷𝟐 𝑫𝑬𝑹𝟐 + 𝜷𝟑 𝑷𝑩𝑹𝟑 + 𝜺𝒊
𝛾: (Dependent) Stock Price/Return 𝛽1 , 𝛽2 , 𝛽3 : Coefficient Estimates
𝛼: Regression Coefficient 𝜀𝑖 : Error Estimate/Stochastic Estimate
𝐸𝑃𝑆1 , 𝐷𝐸𝑅2 , 𝑃𝐵𝑅3 : (Independent) Earnings Per Share, Debt to Equity Ratio, Price to Book Ratio
3. Regression Model and Estimates
For this study, Ordinary Least Square regression models were used. The calculations conducted for the
research can be found in (Table 1/2) in the appendix. Graphs of partial regressions were also used to
visualize the effects of certain factors on each stock (Figure 2).

4. Hypothesis
Our hypothesis is that there is a positive relationship between EPS and PBR and each individual stock in
the tech industry. Thus our null hypothesis (H0 ) is 𝛽𝑛 is less than or equal to zero, signifying there is no
relationship of EPS/PBR on stock price or returns, and our alternative hypothesis (Ha ) states that 𝛽𝑛 > 0,
that there is a positive relationship between CPI and EPS on stock prices and returns. For DER, we
hypothesize that there is a negative relationship and have a null hypothesis that 𝛽𝑛 ≥ 0 and alternative
hypothesis that 𝛽𝑛 < 0. These two theories are based on the idea that for EPS and PBR, the firm is
increasing the value per share which should have a positive effect on the stock price and return. As for
DER, it may not influence stock price depending on how the debt is utilized for the firm.

Null Hypothesis: H0 : 𝛽𝑛 ≤ 0 Alternative Hypothesis: Ha : 𝛽𝑛 > 0

IV. Empirical Results and Analysis


In analysis of the findings, we will be utilizing three different calculations. The outputs of our regressions
generated from Python’s StatsModels can be seen in (Figure 1). We will be analyzing these calculations
with a 95% significance level (α = .05) and critical t-value of 1.684-1.699 with degrees of freedom
ranging from 29-41.

For the EPS with the coefficients being positive, this indicates that an increase in the independent variable
EPS would result in an increase in the dependent variable in the stock price. As these values were
calculated using log-log or double-log regressions, this value shows elasticity in the relationship, with a
1% increase in EPS leading to a 𝛽𝑛 % increase in the stock price. To confirm if these calculations are
significant, we look next to the t-statistics and compare them to our critical t-value. This study found that
the hypothesis that our variables had a positive effect on stock price, where we rejected the null
hypothesis 11/15 times, while returns rejected the null 2/15 times.
With these models we can forecast predictions for the following quarter by inputting the estimations of
the ratios into our model (Table 4). It is noteworthy that as these models only account for 70-82% of the
variance, they may not be accurate estimations of future stock prices. Estimations for returns found in
(Table 5), are less accurate as the models reflect low r-squared values.

V. Conclusion

In accord with many research studies previous, this study finds similar findings in that certain micro-
economic factors have significant influence on stock prices. The determinants found to have this
correlation include earnings per share, price to book ratio. With respect to stock returns, this study finds it
difficult to find significant correlation between the factors chosen EPS, DER, PBR. This study contends
that there may be other explanatory factors outside of the study that may contribute to elements of the
share price and returns.
References

Collins, John. “How to Study the Behavior of Bank Stocks.” The Analysts Journal, vol. 13, no. 2, 1957,
pp. 109–113. JSTOR, www.jstor.org/stable/4468771.Sharma, S. (2011). Determinants of equity share
prices in India. Journal of Arts, Science & Commerce, 2(4), 51-60.
Almumani, Dr. Mohammad Abdelkarim. “Determinants of Equity Share Prices of the Listed Banks in
Amman Stock Exchange : Quantitative Approach.” (2014).
William C. Barbee, Jr., et al. “Do Sales-Price and Debt-Equity Explain Stock Returns Better than Book-
Market and Firm Size?” Financial Analysts Journal, vol. 52, no. 2, 1996, pp. 56–60. JSTOR,
www.jstor.org/stable/4479907.
Patel, Hiren. "Target Price Achievement and Target Price Accuracy Models: An Analysis of Advisory
Firms’ Recommendation for the Indian Banking Stocks." Global Business Review (2018):
097215091880709. Web.
Utami, Widya Retno et al. “The Effect of Internal and External Factors on Stock Return: Empirical
Evidence from the Indonesian Construction Subsector.” (2015). Web.
Dharmendra Singh (August 1st 2018). Stock Price Determinants: Empirical Evidence from Muscat
Securities Market, Oman, Firm Value - Theory and Empirical Evidence, Paolo Saona Hoffmann,
IntechOpen, DOI: 10.5772/intechopen.77343. Available from: https://www.intechopen.com/books/firm-
value-theory-and-empirical-evidence/stock-price-determinants-empirical-evidence-from-muscat-
securities-market-oman
“Yahoo Finance - Business Finance, Stock Market, Quotes, News.” Yahoo! Finance, Yahoo!,
finance.yahoo.com/.
Wharton Research Data Services. Wharton Research Data Services, wrds-web.wharton.upenn.edu/wrds/.
“Daily Stock Market Overview, Data Updates, Reports & News.” Daily Stock Market Overview, Data
Updates, Reports & News, www.nasdaq.com/.
“The Long Term Perspective on Markets.” Macrotrends, www.macrotrends.net/.
Appendix
Table 1: Ordinary Least Square Regression Test Results, Ln(Prices): Ln(EPS,DER,PBR)

Variables Coefficient Std. Error t-statistic P > |t| 𝑅2 Hypothesis


Facebook EPS 1.3292 0.629 4.812 0.000 0.827 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
PBR 0.4566 0.183 7.275 0.134 0.827 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
DER -3.6937 1.220 -3.027 0.006 0.827 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
Apple EPS 0.9133 0.153 5.976 0.000 0.885 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
PBR 0.0871 0.209 0.416 0.680 0.885 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
DER 1.1581 0.224 5.172 0.000 0.885 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
Amazon EPS 0.2338 0.082 2.865 0.007 0.813 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
PBR 1.4095 0.410 3.434 0.001 0.813 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
DER 1.5822 0.431 3.672 0.001 0.813 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
Netflix EPS 3.5041 0.933 3.755 0.001 0.635 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
PBR 0.2002 0.312 0.642 0.525 0.635 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
DER 1.6428 0.687 2.392 0.022 0.635 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
Google EPS 1.1313 0.106 10.635 0.00 0.783 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
PBR 1.0363 0.502 2.065 0.046 0.783 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
DER 0.1536 2.061 0.075 0.941 0.783 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
Table 2: Ordinary Least Square Regression Test Results, Ln(Returns): Ln(EPS,DER,PBR)

Variables Coefficient Std. Error t-statistic P > |t| 𝑅2 Hypothesis


Facebook EPS -0.0140 0.012 -1.203 0.240 0.222 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
PBR -0.0446 0.019 -2.371 0.026 0.222 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
DER 0.0131 0.078 0.169 0.867 0.222 H0 : b1 ≥ 0
Ha : b1 < 0
Apple EPS -0.0053 0.009 -0.575 0.569 0.059 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
PBR -0.0161 0.013 -1.278 0.209 0.059 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
DER 0.0183 0.014 1.355 0.184 0.059 H0 : b1 ≥ 0
Ha : b1 < 0
Amazon EPS -0.0017 0.003 -0.616 0.542 0.043 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
PBR -0.0112 0.014 -0.819 0.418 0.043 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
DER 0.0181 0.014 1.261 0.215 0.043 H0 : b1 ≥ 0
Ha : b1 < 0
Netflix EPS 0.0101 0.023 0.442 0.661 0.083 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
PBR -0.0139 0.008 -1.818 0.077 0.083 H0 : 𝛽1 ≤ 0
H a : 𝜷𝟏 > 0
DER 0.0147 0.017 0.872 0.389 0.083 H0 : b1 ≥ 0
Ha : b1 < 0
Google EPS 0.0068 0.005 1.465 0.152 0.102 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
PBR -0.0149 0.022 -0.682 0.500 0.102 H0 : 𝜷𝟏 ≤ 0
Ha : 𝛽1 > 0
DER 0.0548 0.090 0.612 0.545 0.102 H0 : b1 ≥ 0
Ha : b1 < 0
Table 3: Correlation Coefficient Matrix for Independent Variables
Table 4: Forecasted Stock Prices: Facebook, Apple, Amazon, Netflix, Google | August 24th, 2019
Facebook Stock 177.75 Netflix Stock 291.44
EPS PBR DER EPS PBR DER
Forecasted Ratios: 1.9 5.72 0.08 Forecasted Ratios: 0.7 20.9 2.2
Model: 3.0278 1.3292 0.4566 -3.6937 Model: 1.6624 3.5041 0.2002 1.6428
ln: 1.064711 1.905088 0.076961 ln: 0.530628 3.086487 1.163151
3.0278 1.415214 0.869863 -0.28427 1.6624 1.859374 0.617915 1.910824
𝑦̂ 5.028606 𝑦̂ 6.050513
Prediction 𝑌 = 𝑒 ŷ 152.7199 Prediction 𝑌 = 𝑒 ŷ 424.3308

Apple Stock 202.64 Google Stock 1153.58


EPS PBR DER EPS PBR DER
Forecasted Ratios: 2.83 9.96 1.128 Forecasted Ratios: 13.11 4.17 0.07
Model: 2.9891 0.9133 0.0871 1.1581 Model: 2.4569 1.1313 1.0363 0.1536
ln: 1.342865 2.394252 0.755183 ln: 2.646884 1.642873 0.067659
2.9891 1.226438 0.208539 0.874577 2.4569 2.99442 1.702509 0.010392
𝑦̂ 5.298655 𝑦̂ 7.164221
Prediction 𝑌 = 𝑒 ŷ 200.0675 Prediction 𝑌 = 𝑒 ŷ 1292.354

Amazon Stock 1749.62 ** Forecasted EPS, PBR, DER ratios found via
EPS PBR DER https://www.nasdaq.com/
Forecasted Ratios: 7 17 1.2 https://www.macrotrends.net
Model: 1.4514 0.2338 1.4095 1.5822 https://finance.yahoo.com/
ln: 2.079442 2.890372 0.788457
1.4514 0.486173 4.073979 1.247497
𝑦̂ 7.25905
Prediction Y = 𝑒 ŷ 1420.906
Table 5: Forecasted Stock Returns: Facebook, Apple, Amazon, Netflix, Google | August 24th, 2019
Facebook Return Netflix Return
EPS PBR DER EPS PBR DER
Forecasted Ratios: 1.9 5.72 0.08 Forecasted Ratios: 0.7 20.9 2.2
Model: 0.097 -0.014 -0.0446 0.0131 Model: 0.0273 0.0101 -0.0139 0.0147
ln: 1.064711 1.905088 0.076961 ln: 0.530628 3.086487 1.163151
0.097 -0.01491 -0.08497 0.001008 0.0273 0.005359 -0.0429 0.017098
𝑦̂ -0.00186 𝑦̂ 0.006855
Prediction 𝑌 = 𝑒 ŷ -0.00186 Prediction 𝑌 = 𝑒 ŷ 0.006879

Apple Return Google Return


EPS PBR DER EPS PBR DER
Forecasted Ratios: 2.83 9.96 1.128 Forecasted Ratios: 13.11 4.17 0.07
Model: 0.0286 0.0053 -0.0161 0.0183 Model: 0.0088 0.0068 -0.0149 0.0548
ln: 1.342865 2.394252 0.755183 ln: 2.646884 1.642873 0.067659
0.0286 0.007117 -0.03855 0.01382 0.0088 0.017999 -0.02448 0.003708
𝑦̂ 0.01099 𝑦̂ 0.006028
Prediction 𝑌 = 𝑒 ŷ 0.01105 Prediction 𝑌 = 𝑒 ŷ 0.006046

Amazon Return ** Forecasted EPS, PBR, DER ratios found via


EPS PBR DER https://www.nasdaq.com/
Forecasted Ratios: 7 17 1.2 https://www.macrotrends.net
Model: 0.027 -0.0017 -0.0112 0.0181 https://finance.yahoo.com/
ln: 2.079442 2.890372 0.788457
0.027 -0.00354 -0.03237 0.014271
𝑦̂ 0.005364
̂
y
Prediction Y = 𝑒 0.005378
Table 6: Confidence Interval Table, Ln(Prices): Ln(EPS,PBR,DER)

Confidence Interval: .025 .975


95%
Facebook EPS 0.953 1.705
PBR -0.151 1.065
DER -6.207 -1.181
Apple EPS 0.604 1.223
PBR -0.337 0.511
DER 0.704 1.612
Amazon EPS 0.068 0.399
PBR 0.578 2.241
DER 0.709 2.455
Netflix EPS 1.613 5.395
PBR -0.431 0.832
DER 0.251 0.832
Google EPS 0.916 1.347
PBR 0.019 2.054
DER -4.026 4.333

Table 7: Confidence Interval Table, Ln(Returns): Ln(EPS, PBR, DER)

Confidence Interval: .025 .975


95%
Facebook EPS -0.038 0.010
PBR -0.083 0.010
DER -0.147 0.173
Apple EPS -0.024 0.013
PBR -0.042 0.009
DER -0.042 0.009
Amazon EPS -0.007 0.004
PBR -0.039 0.016
DER -0.011 0.047
Netflix EPS -0.036 0.056
PBR -0.029 0.002
DER -0.019 0.049
Google EPS -0.003 0.016
PBR -0.059 0.029
DER -0.127 0.236
Figure 1: StatsModels Output for Only Least Square Regression for Apple

Figure 2: Partial Regression for Apple to EPS, PBR, DER

Anda mungkin juga menyukai