I am trying to create lead variables: this function is not running anymore (it did in the past).
I do not see the error; using lag works fine...but lead does not run through.
sample_did$lead.x1 = ave(sample_did$x1 , sample_did$group_id, FUN=lead)
Message:
Error in UseMethod("lead") :
no applicable method for 'lead' applied to an object of class "c('double', 'numeric')"