Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Combining values

From   Richard Goldstein <>
Subject   Re: st: Combining values
Date   Thu, 13 Feb 2003 15:44:00 -0500

do you want this as a number: gen age12=(100*age1)+age2
or as a string: gen str age12=string(age1)+string(age2)?


"Rodrigo Briceņo" 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:
> age1=4
> age2=99
> New variable=499 where the first number represents a code and the second the
> age recorded depending of the first code.
> Thanks for your precious time!
> Regards
> Rodrigo
*   For searches and help try:

© Copyright 1996–2019 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index