If I have set data for a number of locations (such as sales) and know they increase 10% week over week, how would I extend this out to say - 52 weeks out (showing the value for each of those weeks)?
I previously would do this in excel with formula to increment the date by 7 days, and then to add 10% to the prior week for each location. I'm guessing something with time series analysis - I did look at tsibble, and some other forcast packages - but couldn't find anything that would give added data for a set weekly increase.
I included an example of what the data would look like for the existing weeks below.
The desired result would be the same as the existing data below, but would simply extend out for 52 more weeks instead of just having 3 weeks.
library(dplyr)
#> Warning: package 'dplyr' was built under R version 3.4.4
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(reprex)
#> Warning: package 'reprex' was built under R version 3.4.4
ex_data <-
tibble::tribble(
~location, ~date, ~sales,
1L, "5/11/2019", 50,
2L, "5/11/2019", 45,
3L, "5/11/2019", 35,
4L, "5/11/2019", 20,
5L, "5/11/2019", 15,
1L, "5/18/2019", 55,
2L, "5/18/2019", 49.5,
3L, "5/18/2019", 38.5,
4L, "5/18/2019", 22,
5L, "5/18/2019", 16.5,
1L, "5/25/2019", 60.5,
2L, "5/25/2019", 54.45,
3L, "5/25/2019", 42.35,
4L, "5/25/2019", 24.2,
5L, "5/25/2019", 18.15
)
Created on 2019-05-29 by the reprex package (v0.2.1)