Hello,
My name is Christian and I am just beginning as a user of STATA. My question might be a bit silly, however I really need your help since I got stuck and I'm just learning this software. Well, I have a database where "a2" is a numeric variable that every observation such as Cordoba has a value of 4, Buenos Aires a value of 1 and so on. I need to assign a different value to each observation, therefore I created a new variable "ciudad". This new variable is a string variable and now I want to assign to these variable's observations different values, such as for Buenos Aires 9, Cordoba 10, Mendoza 11, etc.
Array
Once I got that done, I will drop "a2" because I need to append more data bases to this one with the same variables but with different scenarios and when I do it, the values overlap. For example, this data base is Argentina and when I append Bolivia, the values of "a2" overlap and the Bolivian cities such a La Paz, Sucre, etc that have the same values such as 4, 1, etc automatically are converted to Buenos Aires, Cordoba, etc adopting the values of the Argentinian Database.
How can I do it?
Thanks and kind regards.
Christian Rojas
Related Posts with Define value label tand conver it to from a string variable to a numeric one
Creating new variable: 'flows' of newborn babies from CPS dataHi everyone, I am using CPS data and I am trying to estimate the effect of a policy change on the s…
Question about panel dataDear all, I am currently working on my MSc thesis in Finance and I use data from Orbis. I need to co…
Synthetic ControlHi. I want to create a synthetic state for my study using the command synth. However my data is at …
Panel data Mixed Logit modelI developed a transport choice model (car, AV, and SAV). The software produces model generic not alt…
Missing value: Generating a new variable but only missing values have been generatedHello, I am working on a firm level panel data. I am trying to create a new variable by subtracting…
Subscribe to:
Post Comments (Atom)
0 Response to Define value label tand conver it to from a string variable to a numeric one
Post a Comment