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
replacing values in a loopDear All This is my first post on statalist. I have a household survey data (119,018 observations).…
How to get residuals series of many regressions?Hello, I want to run 500 regression in one command. dependent series are Y1 to Y500 and three indepe…
Multicollinearity and dummy variablesHello, first time poster here. Having a little trouble with something and was looking for a bit of h…
Use of binary explanatory (control) variables in Difference-in-Difference EstimationHi all, I am conducting a Diff-in-Diff with the following data, which is copied in here by using th…
Robust Hausman TestHi, I was wondering if I have to run the Robust Hausman Test. Should I use the command 'xtoverid' o…
Subscribe to:
Post Comments (Atom)
0 Response to tagging different groups when the number of observations is a multiple of three
Post a Comment