(This article was first published on

**Data based investing**, and kindly contributed to R-bloggers)In this post we’ll look at the odds of a stock market crash from the view point of valuation. We’ll use my favorite valuation measure Shiller P/E or CAPE ratio, which is just like regular P/E except it’s calculated by using earnings of the last ten years instead of just one year.

According to multpl.com, the CAPE ratio is currently at 32.57, which is in the 97th percentile when compared to history. We’ll perform logistic regressions to calculate the probability of a correction (which is defined to be a decline of over ten percent from all-time highs) and the probability of a crash (a decline of over twenty percent). We’ll use data from Robert Shiller to do the analysis. The data is from years 1881 to 2005.

The probability of a correction during the next year is a little bit higher than usual at 25 percent, as you can see at the point where the two lines intersect. Let’s look at the probability of a crash next:

The probability of a crash seems to rise exponentially as the valuations rise. However the probability is less than I expected at fifteen percent.

The R-code used in the analysis is available here.

To

**leave a comment**for the author, please follow the link and comment on their blog:**Data based investing**.R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...