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Ʃ
0 Response to tagging different groups when the number of observations is a multiple of three
Post a Comment