Personal code snippets of @tmasjc

Site powered by Hugo + Blogdown

Image by Mads Schmidt Rasmussen from

Minimal Bootstrap Theme by Zachary Betz

EDA: A Survey into Market Risk Premium

Feb 23, 2020 #finance

This is an exploratory analysis based on the paper cited below. I am interested to explore the relationship of coefficient of variation (CV) between developed and developing countries.

Fernandez, Pablo and Martinez, Mar and Fernández Acín, Isabel, Market Risk Premium and Risk-Free Rate Used for 69 Countries in 2019: A Survey (March 23, 2019). Available at SSRN: or

To classify countries into developed or developing status, I use a general rough guide where country with GDP per capita above 24000 is considered developed. Alternatively, I could use human development index (HDI) but the former is commonly used among many economists.


hl.this = c("China", "United States of America", "Germany", "Japan")

df %>% 
    ggplot(aes(median, cv, col = log(answers))) +
    geom_point() + 
    scale_y_continuous(limits = c(0, 50)) +
    geom_mark_circle(aes(description = country, 
                         filter = country %in% hl.this),
                     col = "darkgray", con.colour = "darkgray") +
    labs(x     = "Median of MRP", 
         y     = "Coefficient of Variation", 
         col   = "Sample Size (log)",
         title = "Market Risk Premium: A Survey (Fernandez, 2019)")

Developed or not does not seem to exhibit any relationship to variation.

df %>% 
    filter(! %>% 
    ggplot(aes(factor(developed), cv)) + 
    geom_point(position = position_jitter(width = 0.2, height = 0)) + 
    scale_x_discrete(labels = c(`0` = "false", `1` = "true")) +
    labs(x = "Developed Country", y = "Coefficient of Variation")