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
Stata 16 on CentOS/RHEL 7Hello, Has anyone had any luck getting Stata 16 to run on CentOS/RHEL 7? It seems like Stata has mo…
Count total number of non-missing strings in a rowHi there! I am working on extracting information from text data and was wondering if there is a way…
Lists with putdocxIs there a way to include lists (bulleted or numbered) via putdocx? `style` seems the most obvious c…
"Estimates save" issue for using regression estimates from memory with outreg2Hi, I am having issues using the outreg2 command/estimates command. I have run a 3 regressions and s…
Problem with ranking observations in a uniform distributionDear all, I have a dataset where i have monthly observations of firms during multiple years. The fo…
Subscribe to:
Post Comments (Atom)
0 Response to Help with long data
Post a Comment