I have a data set in long format – combining prescription data and dates of visits which looks like this – except for the „newvar“ – which I would like to obtain.
|
I guess one solution would be to convert the dataset in the wide format and loop through the prescription dates?
I m looking for a clue how this could be handled in the long format?
Many Thanx, Lynde