I thought I would demonstrate univariate analysis and interpretation for Facebook. The analysis is from the time Facebook became an IPO (2012 through today). This analysis is similar to what you need to do as students for the assignment. I am using R, but you can use Excel or SAS. Don’t forget to sort that data in order of data (oldest to newest), or your time plots will be wrong.
mydata=read.csv("c:/Users/lfult/Downloads/table.csv") #read in the data
attach(mydata)
par(mfrow=c(1,2))
boxplot(Adj.Close, main="FB Adj. Close 12-17")
#by year
yr=factor(c(rep("2012", 155), rep("2013", 252), rep("2014", 252), rep("2015", 252), rep("2016", 252), rep("2017", 7))) #Creating a year variable.
boxplot(Adj.Close~yr, main="FB Adj. Close by Yr", notch=T, col=seq(1:5)) #boxplot by year
## Warning in bxp(structure(list(stats = structure(c(17.73, 20.545,
## 23.290001, : some notches went outside hinges ('box'): maybe set
## notch=FALSE
The boxplot of ALL closing prices shows no outliers. (Those would be indicated with an asterick.) In this data set, the boxplot shows that FB adjusted closing prices are not quite symmetric. The median appears to be slightly closer to the 3d quartile than the 1st, and the tails are of different sizes.
Further, I built boxplots for each year (noting that 2017 only has a few observations). We can see a linear trend in the distribution…We will investigate that with a scatterplot in a second. Also, note that there is a single outlier in 2016. See if you can discover what the notches mean for the boxplots…(Hint, if the upper / lower notches between two do not overlap, there is a “statistically significant” difference between the two years. We will cover that in a few weeks.)
Now, we look at histograms (both counts and relative frequencies).
par(mfrow=c(1,2))
hist(Adj.Close, main="FB Adj. Close 12-17", xlab="Adj.Close", ylab="Counts", col="blue")
hist(Adj.Close, main="FB Adj. Close 12-17", xlab="Adj.Close", ylab="Frequency",col="red",freq=FALSE)
The histograms (one a frequency and one a relative frequency) show a mode (when the data are binned this way) near the lower tail. Of course, the mode is ONLY useful for quantitative data when they are binned. Why?
This is a messy histogram. It doesn’t have a pretty shape at all. Yes, there are a lot of observations near 70. But there are also a lot of observations near 20. That reflects Facebook’s IPO status. You could not describe the distribution as symmetric at all!
We do not yet have an idea of the relationship of returns based on time; that’s the next part of the assignment. At this point, what we can see is that the data have a very large spread. We will confirm that with descriptive statistics.
library(psych)
describe(Adj.Close)
## vars n mean sd median trimmed mad min max range skew
## X1 1 1170 70.78 34.3 74.69 70.17 45.56 17.73 133.28 115.55 0.04
## kurtosis se
## X1 -1.23 1
From the descriptive statistics, we can see that the median is larger than the mean ($74.69 vs. $70.70), indicating that data are not symmetric. The range is large (to the tune of $115.55). This is due to the fact that the stock was an IPO in 2012. The standard deviation of $34.30 is also indicative of the IPO status; the stock has high variability! We could even calcuate the coefficient of variation, the standard deviation / mean * 100. This CV gives us a measure of risk to compare against other stocks. We won’t do that now.
Since this was an IPO 5 years ago, we would expect large variability in the price. Further, since this stock does not provide dividends, it is less likely to have a stable price structure. Let’s look at a scatterplot to see how the stock has behaved over time.
t=seq(1:length(Adj.Close))
plot(Adj.Close~t, xlab="Observation #", ylab="Adj. Close", main="Time Plot for Facebook", col="blue", type="l")
abline(lm(Adj.Close~t), col="red")
Wow. Clearly, Facebook has had a strong upward trend based on observation number! (Note: we did not fill in any missing days…would this be problematic..?) The univariate distributions could not tell us that (unless we parsed by year!) Further, there appears to be some cycling, although we would have to investigate that using methods outside of this course. From a decision-making perspective, this scatterplot helps us understand that the adjusted closing price (as expected from a good IPO) starts uncertain and then progresses upwards with time. It is possible that you could refine these models to forecast performance, since there appears to be both an upward pattern and seasonality. Of course, we are not forecasting anything yet.
Overall, descriptive statistics have helped us understand the wide variation of the stock price, which is typically associated with a 5-year risk analysis. Also, we have seen that the scatterplot suggests a strong increase in adjusted closing price over time. As a decision maker, you would definitely want to investigate other patterns that might exists (e.g., cycles).
Bottom Line: we know understand descriptively the performance of adjusted closing prices for Facebook over the last five years. This should help inform our decision about whether to buy / sell or long / short it. Obviously, we would have a lot more work to do here, but this gets us going.