Hi everyone- I am a new user here.
I am running into a problem.
STATA does not allow to use more than 10 arguments for strings- and says expression too long. However, I have more than 10.
For example- there are multiple ICD9 codes for myocarditis, and to get all the patients with myocarditis, I would need to get all those ICD codes. a nd then I place them as binary values 1=present and 0=absence of this diagnosis.
If I make two variables like myocarditis1 and myocarditis 2 with less than 10 arguments each so that STATA wont give error message, it will make a new column for each variable : myocarditis1 with 0 and 1, and similarly a new column with 0 and 1 for myocarditis 2. How can I combine those two variable columns to get a single column? The code I use to generate myocarditis variable is . 1/25 is because there are 25 columns for the codes for diagnosis from DX1 to DX25.
gen myocarditis1=0
forvalues j=1/25{
replace myocarditis1=1 if inlist(DX`j', "4290", "42299", "42290", "07423","07420", "03640", "03643", "4220" )
}
label variable myocarditis1 "myocarditis2"
And for myocarditis 2
gen myocarditis2=0
forvalues j=1/25{
replace myocarditis2=1 if inlist(DX`j', "I514", "I408", "I409", "B3320", "A3950", "A3952", "I401", "I400", "A381", "J1082", "I41" )
}
label variable myocarditis2 "myocarditis2"
Thank you.
Laxmi
Related Posts with Expression too long
Difference-in-Difference - collinearityDear Statalisters,
I am relatively new to Stata, so please bear with me. Also, I am aware that thi…
Confusion w/ model specifications and outcomesHello,
I write my thesis atm and I want to investigate the relationship between an almost constant …
Wage decomposition for migrant-native using the code oaxacaI study wage differential between migrant and natives and I use oaxaca as below
Code:
oaxaca depva…
What indicator could I use for the following problem?I am examining the mismatch between field of study during college and future employment, and how the…
Choosing the highest value of a variable in each category corresponding to another variableHello all,
I have Var1, which is postal codes, and Var2, dissemination area codes, for which there a…
Subscribe to:
Post Comments (Atom)
0 Response to Expression too long
Post a Comment