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
Stata 17 neededDear all, First of all, I hope this post find you all fine. Second of all, I know that my request c…
spmap point data: Display Alaska and Hawaii next to contiguous United StatesDear Users, I want to draw a point map with locations of firms by coordinates displaying Alaska and …
Help needed in creating bar charts of selected countriesHi, I would need some help in creating bar charts that look like this: Array This is what my data…
Fixing a sample so observations between specifications are the same to enable comparisonsIn my regressions, I add variables across five specifications in which the last contains all the var…
sample size calculation when there are three groups Hi, We are planning to conduct an RCT comparing nitroglycerine patches to decrease the failure rat…
Subscribe to:
Post Comments (Atom)
0 Response to tagging different groups when the number of observations is a multiple of three
Post a Comment