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
factor variables and interactionsHi, Suppose, I have three variables: An outcome, a dummy variable D=0,1, and a variable with three …
How do I reformat data from excel in bulk while importing?Hi, I'm fairly new to Stata, so this question may be somewhat basic I need to import a decent amou…
simple stacked bar with two different continous variables on x axisHello and happy Good Friday I'm trying to reproduce in STATA a following stacked bar chart (done i…
Short panel, random-effects model with heteroskedasticity, autocorrelation and cross sectional independence problemsHi everyone, I'm working with a short panel (N=95, T=6). I have carried out the robust Hausman test …
poisson regression resultpoisson regression result Today, 02:13 i am doing research on determinants of crop diversity and po…
Subscribe to:
Post Comments (Atom)
0 Response to tagging different groups when the number of observations is a multiple of three
Post a Comment