Dear all,
in one of my recent projects I collected hierarchical data with 14 observations (1 observation a day) for every subject. Unfortunately, the only variable to identify the measuring time is the date variable.
Example:
ID Date
1 mm.dd.yy
1 mm.dd.yy
1 mm.dd.yy
1 mm.dd.yy
1 mm.dd.yy
2 mm.dd.yy
2 mm.dd.yy
2 mm.dd.yy
2 mm.dd.yy
2 mm.dd.yy
To save some time I asked myself now, if it's possible to recode the date variable into a nummeric variable in stata? Since every research subject had its own starting point, I need to take into account, that it's not that just one day can be transferred into a number. I would prefer a data structure like this:
ID Day
1 1
1 2
1 3
1 4
1 5
2 1
2 2
2 3
2 4
2 5
I'm really looking forward to your answers.Thanks in advance.
Best,
Sascha
in one of my recent projects I collected hierarchical data with 14 observations (1 observation a day) for every subject. Unfortunately, the only variable to identify the measuring time is the date variable.
Example:
ID Date
1 mm.dd.yy
1 mm.dd.yy
1 mm.dd.yy
1 mm.dd.yy
1 mm.dd.yy
2 mm.dd.yy
2 mm.dd.yy
2 mm.dd.yy
2 mm.dd.yy
2 mm.dd.yy
To save some time I asked myself now, if it's possible to recode the date variable into a nummeric variable in stata? Since every research subject had its own starting point, I need to take into account, that it's not that just one day can be transferred into a number. I would prefer a data structure like this:
ID Day
1 1
1 2
1 3
1 4
1 5
2 1
2 2
2 3
2 4
2 5
I'm really looking forward to your answers.Thanks in advance.
Best,
Sascha
Comment