Skip to content
Advertisement

Tag: lag

Lag of values from 1 month ago

My initial dataset has only 2 columns, date and value. What I’m trying to do is, for each date, get the value from the previous month (columns m-1 and m-12). The problems I’m having is when the day doesn’t exist in previous month, like 29 of February, that I want to leave it empty, and most methods tend to get

Advertisement