Displaying 1 result from an estimated 1 matches for "conditional_time".
2009 May 09
4
Generating a "conditional time" variable
...point me
toward an R function/package that could speed up my processing time.
Thanks a lot for your help!
##
My dataframe includes the variables 'year', 'id', and 'eif' and has +/- 1.9
million id-year observations
I would like to do 2 things:
-1- I want to create a 'conditional_time' variable, which increases in
increments of 1 every year, but which resets during year(t) if event 'eif'
occured for this 'id' at year(t-1). It should also reset when we switch to a
new 'id'. For example:
dataframe = test
year id eif conditional_time
1...