Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: SV: Combining string and numeric variables

From   Nick Cox <>
To   "" <>
Subject   Re: st: SV: Combining string and numeric variables
Date   Wed, 4 Dec 2013 12:08:47 +0000

To get a composite variable, this is, in spirit, what is recommended
in Stata Tip 52, which I mentioned earlier. The syntax would be more

egen Country_Region = group(Country Region), label

as -group()- is an -egen- function.

Something like

reshape wide var, i(Country Region)


reshape wide var, i(Country_Region)

wouldn't work without a -j()- option.


On 4 December 2013 11:29, Christian Trolle <> wrote:
> Is it possible to do it like this
> gen Country_Region = group(Country Region), label
> and then use reshape wide var (i) (Country Region)
Miguel A. Duran

I have a panel data set in long form. This panel data set has two
variables to identify observations, one for country (eg, UK) and one
for region (eg, 11 or M0). I have to transform the dataset into wide
> Nevertheless, to do this, if I am not mistaken, previously I have to combine these two identifying variables (to generate, eg, values such as UKM0). Does anyone know whether this can be done with Stata? Thanks in advance.
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index