Hi Everyone,
I am fairly new to stata and I am looking at cancer data. I have histology groupings for lung cancer. The groups all over the place so it is hard to include ranges but I included them where I could. The code works perfect but it just seems long and messy. I am looking for a way to make this code more efficient. I apologize in advance if this is an easy fix and Thanks in advance for any help!
recode HistologicTypeICDO3 (8051/8052 =0) (8070/8076=0) (8078 =0) (8083/8084 =0) (8090 =0) (8094 =0) (8120 =0) (8123 =0) (8002 =1) (8041/8045 =1) (8015 =2) (8050 =2) (8140/8141 =2) (8143/8145 =2) (8147 =2) (8190 =2) (8201 =2) (8211 =2) (8250/8255 =2) (8260 =2) (8290 =2) (8310 =2) (8320 =2) (8323 =2) (8333 =2) (8401 =2) (8440 =2) (8470/8471 =2) (8480/8481 =2) (8490 =2) (8503 =2) (8507 =2) (8550 =2) (8570/8572 =2) (8574 =2) (8576 =2) (8012/8014 =3) (8021 =3) (8034 =3) (8082 =3) (8003/8004 =4) (8022 =4) (8030/8033 =4) (8035 =4) (8200 =4) (8240/8241 =4) (8243/8246 =4) (8249 =4) (8430 =4) (8525 =4) (8560 =4) (8562 =4) (8575 =4) (8000/8001 =5) (8010 =5) (8005 =5) (8011 =5) (8020 =5) (8046 =5) (8095 =5) (8124 =5) (8130 =5) (8146 =5) (8160 =5) (8170 =5) (8230/8231 =5) (8247 =5) (8263 =5) (8312 =5) (8340/8341 =5) (8350 =5) (8370 =5) (8441 =5) (8460 =5) (8500/8501 =5) (8510 =5) (8524 =5) (8530 =5) (8551 =5) (8580/9999 =5) ,gen (Histologygroup)
label define Histologygroup 0 "Squamous Cell Carcinoma" 1 "Small Cell Carcinoma" 2 "Adenocarcinoma" 3 "Large Cell Carcinoma" 4 "Other Specified Carcinoma" 5 "Unspecified Carcinoma"
label values Histologygroup Histologygroup
Calandra
Related Posts with How to recode data with multiple groups
mutiple imputation mixed effect model predicted valueDear members, I am analyzing a cross-sectional big dataset includes serval CVDs and demographic data…
bootstrapped indirect effects through multiple mediators using semDear statalisters, I am trying to run a mediation analysis with 2 indepvars, 5 mediators and 1 depv…
synthetic control missing dataHi all, I'm running a synth and there are no observations for any of my variables in some periods, …
Count the lenght in numeric observationsHello, I am working with a numeric variable that, on some occasions, uses 10 digits, and 8 in other…
Multilevel regression analysis with plausible values as dependent variable (PISA)Hello everyone I am currently working with PISA data from 2018 and face a problem combining the “re…
Subscribe to:
Post Comments (Atom)
0 Response to How to recode data with multiple groups
Post a Comment