Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

1.

Notes about how to treat the topic


We should first gather the assets that will be used to build the PF:
In R, we’ll have:

 A vector firm.
 A vector firms ID
 A vector ROE
Additional variable that can potentially be helpful to explain the mean reverse pattern.

 Market cap: changing according to the stock price, due to possible good news from the firm:
higher dividends, expansion projects.
Accuracy testing of the mean reversion phenomenon.

 A t-stat of the difference between the mean ROE of the 2 groups of portfolios each year. So
10 t-stat? PROF said no need to go that far

2. Notes about the article


2.1. The ROE is an input for
 Operating decision
 Non-operating investment
 Financing decision (debt? New equity?)

2.2. What the article is about (in a nutshell)


The authors try to forecast future balance sheet, income statement and other financial statements. To
do so, they estimate the future change in the macro and microeconomic aspect of the firm.
These external factors are supposed to translate into the financial figures of the firms, as change in
sales, change in expenses, in investment and financing costs …

2.3. Growth behavior of common financial metrics


The revenue growth behavior
While trying to forecast the elements of financial statement, we might be interested in knowing how
they basically change or grow. An important element in the revenue. The authors argue that the
revenue growth rates tend to be “mean reverting”. The pattern has been tested for all publicly traded
European firms (non-financial) from the compustat data base between 2001 and 2020.
See page 245 how they build the portfolios
Potential explanation to the mean reverting phenomenon:

 Mature companies can not grow indefinitely. There is always a reversing point (revert to
average) eventually because of demand saturation and intra industry competition. So, making
forecast with the current high grow rate is unrealistic.
 So the mean reversing point will depend on firm’s industry and competitive position
The earnings growth behavior
Change in a random walk model…
The ROE behavior
Potential explanation of the mean reversion of ROE

 Firms with abnormally high ROE tend to have earnings decline (or increase if ROE
abnormally low)
 When a firm has a high ROE, they expand their investment base meaning that they invest
more, since the ratio is high. The obviously make the denominator of the ratio higher (equity)
and therefore, the returns drop is the latter doesn’t follow the increase in equity.
 In fact, the new or additional investment doesn’t generate proportional earnings. Hence, the
ROE falls
So, we observe the mean reverting pattern (page 246). It has been tested on the same sample as above
for revenues.

3. Questions to the professor today


 Sample: 1990 till 2010 swiss firms listed on SIX
 Struggle in R/Portfolio building: maybe importing data and creating data frame for each
variable (years, firms ID, ROE) can be ok. Also building data frame of the 1 st year 2001 and
computing the mean ROE of the highest till the lowest seems also feasible. But how do I
identify the firms that I putted in a particular portfolio to compute the mean ROE for the
following year? This is what will be repeated 9 times.
 Data to import from data stream:
 possible to download them in excel and then putting them in R? yes
 For the analysis: download the CAPEX, incomes, or equity also, to explain the mean
reversion pattern?
 Explaining the mean-reversion phenomenon: downloading CAPEX, Revenue, and equity
Professor’s comment
ROA from excel as csv files
Replace the firms’s name with firm ID
Average in the PF
AND Average from each starting period
So should replace date with – 10 to +10

4. Question to the professor on march 29th


Do we take dead firms also?
Should we remove missing data before putting firmID or the reverse? I did firm ID and then missing
data
5. Project
5.1. How to import data from excel to R as a new data frame

Afterward, we can decide the type of data we import: character, date, numeric etc.

5.2. How to reorder the columns


The columns’ indexes are defined in the beginning when I create my data frame. For example, if I
import an excel sheet with dates, firms’ names, and ROE as variables and in this order, then then
variables’ ID will be respectively 1 for dates, 2 for firms’ names and 3 for ROE.
Reorder columns:
We might want to show the year column before the firm ID column or the reverse. We will just type
the following code and order the column indexes how we want the columns to be shown.
Code: df <- df[, c(2,1,3,4)]

5.3. How to order the data


Attention: order() returns the indices of the sorted vector, while sort() returns the values of the sorted
vector. Here, we need the indices.
df <- df[order(df$firm_ID, df$year),]
head(df): this function head is used to let us see the beginning of the data frame, just the first row to
see what it looks like. The function order aim to organize the data according to a particular variable. In
our example, we decided to organize them the following way:

 First by firm_ID: so we want to see the firm who has the ID 1 first etc
 Second, as a first order is provided by the ID, inside each ID, we want the data to show the
most recent data first. So, the earliest year which is 2016 in ID 1, is show, then 2017 etc until
ID 2. And then we can go back to year 2016 again.

5.4. How to extract a variable from a data frame as a new vector


I have a data frame called ROE:test with “Name” as a variable (among other). I want to extract it in a
new vector named: AllNames:
Code: AllNames <- ROE_test$Name

5.5. How to create the firm IDs from the firms’ names
My data frame contains the name of the firms and their respective ROE. I want to assign them an ID
(to each firm). Firm_ID is the new variable.
Code: ROE_test <- ROE_test %>%
+ group_by(Name) %>%
+ mutate(firm_id = group_indices())
Now my 4 variables and their ID are:

 1Dates
 2Names
 3ROE
 4firm_ID

5.6. How to remove the missing data


I create a new vector with no missing data. I could also call this new vector as the previous. In this
case, the data frame without missing date would replace the one with. But as I want to keep both, I
give a new name to the new data frame.
Code: ROE_NOmiss <- ROE_test[complete.cases(ROE_test),]
As we can see, the new data frame has a few observations lower than the original one. The missing
data where removed.

5.7. How to build the portfolios


Now that I can identify the firms with a single indice, I want to create my portfolio in the year 2000
which is the first year, namely the formation year.

5.7.1. Sort the column by year


I need to sort my columns first by showing the year: because I want to built portfolio and compute
their mean ROE each year. So, the right order to do so is: dates, firmID, ROE and Names.
Code: ROE_test <- ROE_test[, c(1,4,3,2)]

5.7.2. Compute the mean ROE of the 20% best ROE during the first year
To build the portfolio for the first time, I need to identify the 20% best ROE during the portfolio
formation year which is 2000.
Extract ROE from the data frame to compute the ROE of the best in 2000?
Or just create a formula to compute ROE for a particular year (2000) and for the 20% highest and then
the second 20% highest etc
So, I will end up with a data frame with
Computation of the mean ROE of each year
group_means <- ROE_test %>%
+ group_by(Dates) %>%
+ summarise(mean_variable = mean(ROE))

Seems like 2000 is the only year having missing data. I got this result before removing missing data.
After doing so, the results are:

Computation of the mean ROE of each firm (by firm_id)


Meanfirm <- ROE_test %>%
+ group_by(firm_id) %>%
+ summarise(meanfirm = mean(ROE))

NB: This code doesn’t work if firm_id is numeric that’s why I changed it as a character variable (see
the code below).
Change the fimrs’ ID from numeric to character (this is maybe not necessary)
Code: ROE_test <- ROE_test %>%
mutate(firm_id = as.character(firm_id))

Subtract data from a data frame


I want to remove the data or the rows (lignes) that belong to 2001.
ROE2000 <- subset(ROE_NOmiss, Dates != "2001")

Another way to plot the ys and the x


- Create a vector year
- Create vectors for each of the meanROEs of the 5 portfolios

You might also like