[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Combining values
"Rodrigo Briceņo" <firstname.lastname@example.org> wrote:
> Hello Stata listers. I was looking in the Faq and did not find any topic
> related with my question. I think is very simple. I need to combine the
> values provided in two variables to make a new variable. For example:
> New variable=499 where the first number represents a code and the second the
> age recorded depending of the first code.
If your age1 and age2 variables are stored as numeric, you can type
. gen newvar = real(string(age1) + string(age2))
This should give you the result you want.
* For searches and help try: