You are evaluating the performance of two stocks, Microsoft and Apple, for future investment.
Hint: Add group_by(symbol) at the end of the code so that calculations below will be done per stock.
The date for this observation is March 8th 1999 for Microsoft (MSFT), with an open only slightly higher than that of the low for the day and a much higher high, this showing alot of movement of the stock throughout the day. The close is almost a full dollar higher than that of the open with the adjusted showing an gradual increase over the nct 9 days. We see a volume of 46,726,000 stocks purchased.
Hint: Use ggplot2::facet_wrap. Refer to the ggplot2 cheatsheet. See the section for Faceting.
Hint: Take the adjusted variable from Stocks, and calculate yearly returns using tq_transmute(), instead of tq_mutate(), which is used when periodicity changes. Another difference between the two is that tq_transmute() returns only newly-created columns while tq_mutate() adds new columns to existing variables.
Hint: Refer to the ggplot2 cheatsheet. Look for geom_boxplot under Two Variables. Note that the discrete variable should be mapped to the x-axis and the continuous variable to the y-axis.
Hint: Discuss your answer in terms of the median in the boxplot you created in Q5. Google “Interpreting boxplots in R” to find the information you need.
Apple has a higher typical yearly return expectation because its average is higher than that of microsoft while also having a higher box position over Microsoft. On top of this we see a higher minimum return and a higher maximum return for Apple.
Hint: Discuss your answer in terms of the interquartile range (the middle 50%) of the boxplot you created in Q5.
Apple, well having higher return also has much higher risk intertwined with that. Apple has a higher deviation and size of the box meaning its earnings are much more spread out and unpredictable where as Microsoft has a smaller box that is much more easily predictable and less risky.
Hint: Change echo and results in the chunk options. The published webpage should display charts.