Analyze Revenue Trends - Regression
Sometimes it is difficult to spot differences by simply eyeballing the data. A slightly more sophisticated tool to determine changes in the data is regression analysis. In this exercise, you will use regression analysis to determine whether the revenue trend has shifted between the historical period and the projection period. A statistically significant shift variable is not necessarily an indicator of bad projections, but it tells us that we may want to dig deeper to find a rationale for the shift in the trend. For this exercise, the data frame rev_all
which is stored in memory, contains the historical revenues (first 8 years) and projected revenues (last 5 years) under the rev_proj
variable name.
Note: A typical threshold for statistical significance is if the p-value of the trend variable is less than or equal to 0.10.
This exercise is part of the course
Equity Valuation in R
Exercise instructions
- Create a
trend
variable for historical and projected revenues. - Create a trend
shift
variable that identifies the projection period. - Regress revenue projections (
rev_proj
) on thetrend
andshift
variables, using therev_all
data. - Print the summary of
reg
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create a trend variable
rev_all$trend <- ___
# Create shift variable
rev_all$shift <- ___
# Run regression
reg <- lm(___)
# Print regression summary
___