How can I use a lag function applied by groups?
I have data where I'd like to compute the lag from one row to the next (it is a time series), but I have data for many groups. I want the lag created within each group separately. For many statistical functions (e.g., Col Mean) there is the option to add one or more By Group variables. There does not appear to be the same functionality for the Lag or Dif functions and I can't find anything in t...
