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
Splitting a dataset into multiple datasetsHey all, Newish to STATA - longtime SAS user - sorry for the basic question. I have a dataset of ca…
Help creating an index variableHi all. I have a panel dataset from Brazilian states with information on the number of radio station…
Export labels from alpha output to ExcelI am estimating the alpha of several variables. I have specified asis, item, and label. I need to be…
Problems with FE in capital structure studyHello all. For my thesis I'm researching the capital structure in the UK and France. More specifical…
Listing out the frequency distributions for multiple variablesHello! Quick question - I have data from a survey where participants can select multiple options fo…
Subscribe to:
Post Comments (Atom)
0 Response to tagging different groups when the number of observations is a multiple of three
Post a Comment