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
Create vars with conditions inside a loopHi, I have the next data Id n_lo1 gr1 gr2 gr3 gr4 gr5 gr6 Pri 01 0600 15 30 54 78 96 45 A1 02 0700…
Omitted variables due to collinearity in PPML regressionsDear Statalist, I am trying to run gravity regressions on the impact of FTA's for different sectors…
Using georoute with zipcodesHi all, I'm trying to generate driving distance between a variable with zip codes only and a variab…
Interpretation of standardized coefficientsI know that we have previously discussed how the use of standardized coefficients may obfuscate resu…
Testing for uniform distributionThis thread suggests that to test for the sample uniform distribution quantile command can be used. …
Subscribe to:
Post Comments (Atom)
0 Response to Help with long data
Post a Comment