Hello,
I want to create a variable juridiction that identifies uniquely each juridiction. I have a micro dataset where the State, District and Primary Sample Units (PSU henceforth) are identified. Within a same district, three consecutive PSU belongs to a same juridiction. I already created a variable identifiying the rank of each PSU as follows :
bysort DISTNAME IDPSU : gen nvals = _n == 1
bysort DISTNAME : replace nvals = sum(nvals)
How can I indicate to Stata that every times "nvals" reaches a multiple of three, the variable juridiction should take a new value ?
thank you in advance
Chloé
Related Posts with tagging different groups when the number of observations is a multiple of three
Help creating new variable using regression and fitted values, and creating a rolling average chartDear all, Hope all is well. Context: I am in the process of regressing director-turnover on the bo…
How to properly citing stata's manual and FAQHi, I wonder to know how can I properly cite the below pdf as well as the Stata FAQ. For the FAQ, I …
cloglog and proportional odds assumptionhello,everyone.it's the first time i write here.I hope you can understand my poor English because it…
Using loop to create state-codes for statesHi, I have the following states. I want to assign a 2-digit code to each state. The dataex is given…
Egen with weights?Hello, I am new to Stata and I am trying to calculate the proportion of women in different regions …
Subscribe to:
Post Comments (Atom)
0 Response to tagging different groups when the number of observations is a multiple of three
Post a Comment