Problem Set 6: Creating and Visualizing Forecasts
Part 1: R
Complete a time series decomposition using the time series that you collect for your project.
Generate a “seasonally-adjusted” time series of your observed data. Make note of this variable since you will need to export it with your other data.
Use R to create a 3 year forecast of your chosen time series. Follow the steps we went through in lab. Create a new variable that indicates the new data you have created is a forecast.
Create a dataframe with the following variables:
measure_date
,price
,trend
,seasonal
,residual
,sa_price
,forecast
(indicator of forecasted data).
Part 2: Tableau
In Tableau, connect to the file you exported from R with your original price time series data, the forecast, and the (three) components of your decomposition. If needed for your analysis, filter your data on the
Date
field so that all worksheets in your workbook start at the date you want to begin your analysis.Use observed prices to create a forecast in Tableau that uses an additive trend line and additive seasonality. Recall that you will need to filter these data on your indicator variable for whether the price values are forecasted or not (in lab we named this variable
Forecast
)Create a new visualization that shows the forecasts you created in R. Combine this and the Tableau forecast into a data dashboard. Add a text box to your dashboard and explain any differences between the forecasted estimates and explain why you think the forecasts are different. Once you have created this dashboard you can
hide
your worksheets you used to create this dashboard by right clicking on them and selectingHide
. This will clean up your workbook.Next create a new worksheet that shows each of the components of your forecast decomposition (the one you did in R). Add a discussion of each of these components as a caption in your worksheet – what are the overall trends in the data? Which seasons have higher or lower prices? How much variation is unexplained by the trend and seasonality components?
Finally, create a dashboard that shows seasonal trends in your data by month and by quarter. You can use any visualization(s) of your choosing in this dashboard. Add a text box that describes key take-aways from your analysis and that answers the following questions: Are there more apparent trends in your data when comparing across months or across quarters? Are there noteable differences in the annual trends within a given month or quarter? Do these trends align with the seasonal decomposition you found in your R analysis?
Once you have created your dashboard you can
hide
your worksheets you used to create the dashboards by right clicking on them and selectingHide
. This will clean up your workbook. The final workbook you publish should include your two data dashboards and your single worksheet with the R decomposition.Format your visualizations by adding color, useful titles, appropriate marker labels, text annotations, etc. that help your audience understand your analysis.
Publish this workbook on Tableau public.
How to Submit
You should create a new webpage on your google site titled Problem Set 6
. This webpage should include your responses to both Parts 1 and Parts 2 of the problem set. Part 1 should contain an R script with the code used to answer the questions. Part 2 should include an embedded version of your Tableau dashboards and worksheets (you should be able to toggle between dashboards and worksheets by using tabs in this embedded view, but email Ali if you need help getting this to work). Submit the link to your google site webpage in Canvas.