Dear All,
I have a string variable which captures the ICD-10 codes. However, some of the codes have an excess character at the beginning. This character "D" is constant in all cases. I want to drop the extra D from the cases or ICD-10 codes with this issue.
Please find an example of the data below. Thank you
input int ID str7 ICDcode
1 "DF26530"
2 "DD587"
3 "DS2158"
4 "DW1478"
5 "DF26531"
6 "DD588"
7 "DS2159"
8 "DW1479"
9 "DF26532"
10 "DD589"
11 "DS2160"
12 "DW1480"
13 "DF26533"
14 "DD590"
15 "DS2161"
16 "DW1481"
17 "DF26531"
18 "DD588"
19 "DS2159"
20 "DW1479"
21 "DF26532"
22 "DD589"
23 "DS2160"
24 "DW1480"
25 "DF26533"
26 "DD590"
27 "DS2161"
28 "DW1481"
29 "DF26534"
30 "DD591"
Related Posts with Dropping excess character - String variable
Forming new variable using several existing variablesHi, I am trying to create a variable "IN" that takes value from existing variables "IN_1 IN_2 IN_3 I…
ppmlhdfe: lagged dependent variable as a regressorDear all, I am using ppmlhdfe to estimate a gravity model that includes an auto-regressive (AR) ter…
Different results between Heckman model and separate probit + OLSDear Statalist I'm running a Heckman model and I wanted to compare the results of the Heckman model…
If else inside for each loopI am trying to run the following code and it does not seem to be working. I want to change the refer…
how to keep month end data from daily data (with various month-ending dates)Dear All, I have a daily data set with different month-ending date (sometime on 27 or 28 or 29 or 30…
Subscribe to:
Post Comments (Atom)
0 Response to Dropping excess character - String variable
Post a Comment