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
estadd local not working in Stata 17Since I started using Stata 17, I encountered a problem that I cannot seem to fix. Normally, I would…
Merging two datasetsHello, I have to merge two datasets. The key variable is str32. The problem I'm facing is that in o…
Issues with regression on Asset pricing Models (Panel data)Hello, I am writing my master's thesis; however, I have not reached a standstill regarding running …
Tabulating (counting) within many groups in a dataset does one company appearHello, I'm working with a many:1 dataset where each observation represents a single insurance polic…
xttobit or fracreg for panel data? My dependent variable is from 0 to 1.Hello everyone, I am a PhD student from strategy area. I encountered a problem in model choice. My d…
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