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
Principal Component AnalysisHi I have a non Stata request. I have to use PCA to create an index for cities in my dataset using …
Estimation of pseudo‑panel modelsHello everyone, I have just recently started to learn about pseudo-panel data, and I have some ques…
Additive indexHi dears, I have an issue in creating of an additive index. I have 11 variables that are normalized …
Tests of Conditional Predictive Ability: Giacomini-White TestHello everyone, I need to perform Tests of Conditional Predictive Ability. I used dmariano command …
3-Year Rolling Standard Deviations of ReturnsHey Community, for a paper at university I need a three year rolling standard deviation of returns.…
Subscribe to:
Post Comments (Atom)
0 Response to tagging different groups when the number of observations is a multiple of three
Post a Comment