Hello,
I have a dataset that requires me to reshape the format from long to wide based on the project analysis needed. Below is an example of what my dataset looks like:
I tried using the following code below but got the error message : variable date_of_event takes on too many values
reshape wide event_num, i(id date_of_event) j(num)
I'm obviously doing something wrong but I don't know what exactly that is. I'm new to STATA and I'm still learning the STATA jargons, so any help provided will be well appreciated.
Thank you!
I have a dataset that requires me to reshape the format from long to wide based on the project analysis needed. Below is an example of what my dataset looks like:
id | event_id | date_of_event | event_num |
1 | 20 | 12/5/2017 06:21:37 | 5 |
2 | 20 | 10/22/2017 08:07:03 | 9 |
3 | 20 | 11/14/2016 09:57:57 | 1 |
4 | 20 | 10/30/2016 09:32:11 | 7 |
4 | 20 | 10/30/2016 09:06:34 | 6 |
4 | 20 | 10/30/2016 07:36:31 | 4 |
5 | 20 | 1/1/2018 06:21:02 | 2 |
5 | 20 | 12/18/2017 09:43:10 | 2 |
6 | 20 | 10/15/2016 12:27:46 | 0 |
reshape wide event_num, i(id date_of_event) j(num)
I'm obviously doing something wrong but I don't know what exactly that is. I'm new to STATA and I'm still learning the STATA jargons, so any help provided will be well appreciated.
Thank you!
Comment