Session Ready
Exercise

Growth rates

We can generate growth rates from first differences by combining the first-difference and lagged levels. A one-period growth rate measures the percentage change in a variable, represented by the formula:

(value_today - value_yesterday) / value_yesterday

Remember from the previous exercise, though, that value_today - value_yesterday is just the first difference!

The percentage change can also be computed as:

(value_today / value_yesterday) - 1

The state of dailyDT (with lags and differences added) from the previous exercise has been preserved in this session. You can use str() to examine it.

Instructions 1/2
undefined XP
  • 1
    • Add the one-period percentage change in "sales" using the precomputed lag and difference columns.
    • 2
      • A the two-period percentage change in "sales" without referencing the precomputed lag and difference columns