Packages.
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
library(ggthemes)
library(reshape2)
Load in our IPO data.
ipo <- read.csv("data.csv")
Stats to play with.
str(ipo)
## 'data.frame': 36 obs. of 12 variables:
## $ Year : int 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 ...
## $ Number : int 71 192 77 451 172 187 393 285 102 113 ...
## $ Proceeds : Factor w/ 33 levels "10.40%","11.10%",..: 15 23 7 32 14 22 21 23 18 19 ...
## $ Aggregate_Proceeds: Factor w/ 36 levels "$0.91 billion",..: 1 9 2 35 8 29 5 3 18 32 ...
## $ Market_Price : Factor w/ 35 levels "$10.60 billion",..: 26 1 25 22 34 9 24 23 16 15 ...
## $ NYSE : int NA NA NA 11 8 9 28 26 14 18 ...
## $ Nasdaq : int NA NA NA 418 148 158 327 217 61 78 ...
## $ Other : int NA NA NA 22 16 20 38 42 27 17 ...
## $ Median.Age : int 6 8 5 7 8 9 8 7 8 8 ...
## $ VC.backed : num 0.32 0.28 0.27 0.25 0.26 0.21 0.2 0.23 0.31 0.35 ...
## $ Technology : num 0.64 0.4 0.36 0.38 0.52 0.43 0.4 0.66 0.61 0.66 ...
## $ Profitable : num 0.91 0.88 0.83 0.71 0.8 0.84 0.74 0.86 0.79 0.77 ...
Number of IPOs.
ipo1 <- ggplot(ipo, aes(Year, Number)) + geom_area(fill="#42B5E8", color="#58595B")
last_plot() + theme_minimal(base_family = "RobotoCondensed-Regular") + theme(plot.title=element_text(family="Roboto-Black")) + labs(title = "IPO Volume by Year", subtitle = "Includes both tech and non-tech companies", x="Year", y="")
Aggregate proceeds.
Clean up text first.
ipo$Aggregate_Proceeds <- gsub("billion", "", ipo$Aggregate_Proceeds)
ipo$Aggregate_Proceeds <- gsub("\\$", "", ipo$Aggregate_Proceeds)
ipo$Aggregate_Proceeds <- as.numeric(ipo$Aggregate_Proceeds)
Reshape.
ipo_shaved <- select(ipo, Year, Number, Aggregate_Proceeds)
ipo_shaved$Aggregate_Proceeds <- ipo_shaved$Aggregate_Proceeds * 10
ipo_tall <- melt(ipo_shaved, id="Year")
colnames(ipo_tall) <- c("Year", "Statistic", "Value")
Plot.
ipo2 <- ggplot(ipo_tall, aes(Year, Value, color=Statistic)) + geom_line()
last_plot() + theme_minimal(base_family = "Roboto-Regular") + theme(plot.title=element_text(family="Roboto-Black"), legend.title = element_text(family = "Roboto-Black")) + labs(title = "Number of IPOs and Aggregate Proceeds", subtitle = "Aggregate proceeds are measured in $10M to scale with volume", x="Year", y="") + scale_color_manual(labels=c("Number", "Aggregate Proceeds"), values=c("#58595B", "#42B5E8"))
Shares of indices.
Turn into proportions.
ipo_shaved <- select(ipo, Year, NYSE, Nasdaq, Other)
ipo_shaved <- mutate(ipo_shaved, Total = NYSE + Nasdaq + Other)
ipo_shaved <- mutate(ipo_shaved, NYSE = NYSE / Total)
ipo_shaved <- mutate(ipo_shaved, Nasdaq = Nasdaq / Total)
ipo_shaved <- mutate(ipo_shaved, Other = Other / Total)
ipo_shaved <- select(ipo_shaved, Year, NYSE, Nasdaq)
ipo_tall <- na.omit(melt(ipo_shaved, id="Year"))
colnames(ipo_tall) <- c("Year", "Exchange", "Share")
ipo3 <- ggplot(ipo_tall, aes(Year, Share, color=Exchange)) + geom_line()
last_plot() + theme_minimal(base_family = "Roboto-Regular") + theme(plot.title=element_text(family="Roboto-Black"), legend.title = element_text(family = "Roboto-Black")) + labs(title = "Share of Total IPOs by Exchange", subtitle = "Small percentage of other exchanges not included", x="Year", y="") + scale_color_manual(labels=c("NYSE", "Nasdaq"), values=c("#58595B", "#42B5E8"))
Number by exchange.
ipo_shaved <- na.omit(select(ipo, Year, NYSE, Nasdaq))
ipo_tall <- melt(ipo_shaved, id="Year")
colnames(ipo_tall) <- c("Year", "Exchange", "Number")
ipo4 <- ggplot(ipo_tall, aes(Year, Number, color=Exchange)) + geom_line()
last_plot() + theme_minimal(base_family = "Roboto-Regular") + theme(plot.title=element_text(family="Roboto-Black"), legend.title = element_text(family = "Roboto-Black")) + labs(title = "Number of Total IPOs by Exchange", x="Year", y="") + scale_color_manual(labels=c("NYSE", "Nasdaq"), values=c("#58595B", "#42B5E8"))
Profitability.
ipo5 <- ggplot(ipo, aes(Year, Profitable)) + geom_line(color="#42B5E8")
last_plot() + theme_minimal(base_family = "Roboto-Regular") + theme(plot.title=element_text(family="Roboto-Black"), legend.title = element_text(family = "Roboto-Black")) + labs(title = "Share of IPOs Done By Profitable Companies", subtitle = "Using trailing LTM (last twelve months) earnings", x="Year", y="")
VC-backed companies.
ipo_shaved <- select(ipo, Year, Profitable, VC.backed)
ipo_tall <- melt(ipo_shaved, id="Year")
colnames(ipo_tall) <- c("Year", "Statistic", "Share")
ipo6 <- ggplot(ipo_tall, aes(Year, Share, color=Statistic)) + geom_line()
last_plot() + theme_minimal(base_family = "Roboto-Regular") + theme(plot.title=element_text(family="Roboto-Black"), legend.title = element_text(family = "Roboto-Black")) + labs(title = "Share of IPOs By Profitability and VC Investment", subtitle = "Does not include growth-capital backed IPOs", x="Year", y="") + scale_color_manual(labels=c("Profitable", "VC-backed"), values=c("#58595B", "#42B5E8"))