Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: combine 2 variables |
Date | Tue, 11 Feb 2014 19:27:36 +0000 |
Thanks, but we (I) still don't know what your variable types and values are, exactly. Please show the results of . describe dg1 dg2 . list dg1 dg2 in 1/10 Also add to the variables above whatever identifies your patients. (Use anonymous equivalents by all means if confidentiality is an issue.) Also, show what a new variable should look like. Nick njcoxstata@gmail.com On 11 February 2014 19:22, Dao Kim <Kim.Dao@chuv.ch> wrote: > Most of my patients have 1 diagnosis: ie hemorrhage, asphyxia or stroke (variable dg1) > Some have 2: hemorrhage and asphyxia (another variable dg2); is it possible to associate these two as only one variable for one patient? I am trying to evaluate the efficacy of a drug according to the diagnosis, there are so few patients with 2 diagnoses (dg2) that it doesn't make sense to use it isolated. it does this make more sense? > > -----Message d'origine----- > De : owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] De la part de Nick Cox > Envoyé : mardi 11 février 2014 20:07 > À : statalist@hsphsun2.harvard.edu > Objet : Re: st: combine 2 variables > > Dao Kim: > > This is incomprehensible. > > "combine": what does that mean? > > "Concat" doesn't work. I guess that you tried -egen, concat()- but what exactly did you try? What do you mean by "doesn't work"? What did it do? Why isn't that what you want? > > "merge 1:1 id" -merge- is for merging two or more datasets. That is a completely different problem from combining two variables. > > But forget all that. > > What are your variables? > > What are your observations? > > Please show us an example of your data. > > Please show us an example of what you want to get. > > > Nick > njcoxstata@gmail.com > > > On 11 February 2014 18:59, Dao Kim <Kim.Dao@chuv.ch> wrote: >> Dear Statalists, I try to combine two diagnoses variables to one, for patients that mostly only have 1 diagnosis for seizures etiology, but a minority has 2 etiologies/diagnoses, I can't figure out how to make only one variable. Concat doesn't work, I tried to merge 1:1 id , any idea? Thanks for your help! >> >> * >> * For searches and help try: >> * http://www.stata.com/help.cgi?search >> * http://www.stata.com/support/faqs/resources/statalist-faq/ >> * http://www.ats.ucla.edu/stat/stata/ > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/