Hey all,
I was working on a cluster, and I stuck when I need to give numbering according to var1. So, suppose value in var1 occurs 5 times then, 5 times there should be 1 number and then if value will be a change in var2 then var2 should be increased by 1 number.
Below is an example dataset
var1 var2
Ajmer 1
Ajmer 1
Ajmer 1
Alwar 2
Alwar 2
Alwar 2
Alwar 2
Alwar 2
Alwar 2
Alwar 2
Alwar 2
Banswara 3
Banswara 3
Banswara 3
Banswara 3
Baran 4
Baran 4
Baran 4
Barmer 5
Barmer 5
Barmer 5
Barmer 5
Barmer 5
Best,
Narendra
Related Posts with Auto increment in var2 according to value of var1.
Blinder-Oaxaca DecompositionHello! I am trying to perform a Blinder Oaxaca Decomposition on the log of hourly wages for the gen…
specification test for panel dataHello community after regressing my three models (FE,RE,Poold) I know that I have to choose between …
not losing data when collapsing on spellidI have a situation where I have 5 million records, many of them duplicates spellid's with separate p…
String HandlingHow do I remove trailing spaces for all variables in Stata at once? I know that I can remove spaces …
"type mismatch" in collapseDear all, I'm getting the error message Code: type mismatch (r109) using the collapse function Co…
Subscribe to:
Post Comments (Atom)
0 Response to Auto increment in var2 according to value of var1.
Post a Comment