Combining Two Variables?

Combining Two Variables?

by Kim Grelli -
Number of replies: 1

Hi,


Any suggestions on how to combine two categorical variables into 1 variable?


For more detailed explanation: I have one categorical variable that I generated to identify babies with an MRI at a certain age and a second categorical variable to identify babies with a second MRI at a certain age. I would like to combine both columns of data to reflect all babies with an MRI at that age. None of the values overlap.


Thanks!

Kim

In reply to Kim Grelli

Re: Combining Two Variables?

by Kristen -

If there is no overlap then this will work: 


set obs 10


gen A = 1 in 1/5

gen B = 2 in 6/10

gen C = A

replace C = B if C==.