Hi, I know this may seem simple but I just can't figure it out.
I have 3 variables: Time, serial, code
Time expresses years, serial is a identifier variable and code is a variable which ranges between 1 and 50.
I want to generate a new variable (lets call it "nv") which contains the values of this 3 variables in this order: Time|serial|code
So for example if I have the following:
Time: 1999
serial: 143
code: 4
My new variable should look like this:
nv: 19991434
Thanks for your help.
Related Posts with Generate a variable containing the values of other variables
egen or gen newvar to categorize the 50 states into Democrat, Republican, or Swing based on 2016 election resultsHi y'all I would be most grateful if anyone out there has written a simple code to categorize states…
Coding 0,1,2 for political states in 2016Hi y'all I would be most grateful if anyone out there has written a simple code to categorize states…
Egen or gen newvar to categorize the 50 states into Democrat, Republican, or Swing based on 2016 election resultsHi y'all I would be most grateful if anyone out there has written a simple code to categorize states…
Changing SIF DMYhms Time Variables to DMY Time VariablesI seek to geospatially merge some rainfall data with a master dataset. Before I can do that though, …
Putexcel: More of two decimal in putexcelHi! I have a problem with the next code : Code: * I need more of two decimal in the next test: s…
Subscribe to:
Post Comments (Atom)
0 Response to Generate a variable containing the values of other variables
Post a Comment