Exploration of time series data

Estimated time 60 minutes plus independent work.
In this lab we will begin to explore time series data and series operations such as smoothing,
differencing, and using lags in a model.
Part 1 Data Smoothing and filtering

  1. Please open the lab6bdta. These data were obtained from the EIA and U.S. BEA and contain
    information on energy consumption by fuel and inflation adjusted GDP expressed as an index
    number from 1948 to 2020
  2. Stata like time series data to be in a table with the rows representing years and the columns
    representing the variables in the model. The data from the EIA are already in this format but I
    had to join them with the BEA data using the “transpose” function in excel because the BEA
    reported GDP with each year being a column and the components of GDP in the rows.
    Although I have prepared the data for you already, if you are not familiar with the copy and
    transpose function please take a moment to look it up. In either case include a brief instruction
    on how to copy and transpose in excel in your writeup for future use.
  3. With the datafile open it is now necessary to tell the software that these are time series data.
    This is done using the command .tset , use help to look this command up and write out the basic
    command syntax.
  4. Visualize the GDP and total energy consumption. Since these are time series data a scatter plot
    may not be very useful. .tsline will generate a line plot , generate line plots of GDP and total
    energy consumption then use the .twoway prefix as we did in prior labs to plot GDP and total
    energy together. Assess your plots, do either suggest a time trend? Describe the general trend
    and the shape of these data trends. What function would best describe them?
  5. Make a log transform of the GDP data to see if it produces a more linear pattern using .gen .
    Label your new transformed variable lgdp. Plot this new variable on its own and with total
    energy consumption. Based on visual analysis did this transformation provide any useful
    insights?
  6. Let us try applying a moving average smoothing transformation to these data using .tssmooth.
    Use help to learn the syntax of this command. (You may have noticed the time series commands
    start with ts, for time series.)
  7. Create a 5 year moving average of GDP using .tssmooth, call the new smoothed variable sm1
    (smooth one ). Compare the smoothed and raw GDP trends.
  8. Try to use one other type of smoother described in your textbook, label it sm2 and compare the
    results with sm1.
    Part 2 Time Series Regression Intro
    Please open the lab6 data in STATA. This file contains a reduced form of some data I generated for my
    research. The data are both spatial, by state, AND time series. Remember that data that are time series
    and have set identifiers, in this case a spatial id, are called panel data. Note that panels need not be
    spatial, if you had data by time and any other grouping it is still a panel. This could be research plots,
    population groupings, or cohorts, among many other types of groupings. In this lab we will consider
    the special considerations that need to be made when we work with this type of data.