Hi,
I have previously posted here and received great help. Need help with one last area that I am really struggling with. I am trying to find the type of procedure that occurs for the second procedure. My data shown below is in long format. There are multiple observations per id number.
date_order is the order of the procedure with date_order 2 correlating to the 2nd procedure I am trying to identify.
_j is procedure they had, with _1, _2, and _3 all representing different procedures.
If patients only received one procedure as their 2nd procedure, i.e. only _j == _1 & date_order==2 it would be easy. But some patients received 2 different procedures on their second procedure (or date_order == 2). For example, id = 2 received procedure _1 and procedure _2. I want to create a variable that captures patients who had two procedures for their date_order ==2 and cannot figure it out.
Any help?
----------------------- copy starting from the next line -----------------------
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input float id long date_order str2 _j float proc
2 2 "_1" 43
2 2 "_2" .
2 2 "_2" 42
2 2 "_3" .
2 2 "_3" .
2 2 "_1" .
9 2 "_1" 336
9 2 "_2" .
9 2 "_3" .
9 2 "_2" .
9 2 "_3" .
9 2 "_1" 336
9 2 "_1" 336
9 2 "_2" .
9 2 "_1" 336
Related Posts with Help with long data
Counting number of variables across groupsHi, I have three variables KeyEventDates KeyEventHistory KeyEventDetails that I am splitting into s…
Descriptive statistics for panel dataHi Statalist, I'm struggling to generate the descriptive statistics for my dataset. Here is the exa…
Could I include the survey data of "prefer not to say"?Dear friends, I collect survey data with categorical outcome variables whose outcome includes "prefe…
Interpreting outputs from "raschjmle" commandHi! I am doing my research on Rasch analysis for measuring knowledge. I am using Stata-14 to constru…
Appropriate model to usehello, I have a question on the most appropriate model to use. I have the data set below, I am tryin…
Subscribe to:
Post Comments (Atom)
0 Response to Help with long data
Post a Comment