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.
weighting dataI have an unbalanced panel data, and I'm trying to weight my sample to look like the population. sup…
How do i transform categorical variables to continuous scores?Hello Statlist, I am working on the Health Information National Trends Survey (HINTS) which has 7 v…
Standardising variables across waves in panel data analysis - how?Good morning all from a very gloomy Ireland where we have just reported our highest daily number of …
create new variable with multiple conditionsHello expert stata I'm new to stata. I had an exercise from the class for analysing the data. the fi…
Urgent: How to change the relationship according to HH serial numberDear All, How can I select and create a new data set with all household heads and those household w…
Subscribe to:
Post Comments (Atom)
0 Response to Auto increment in var2 according to value of var1.
Post a Comment