Dear reader,
I would like to flag a certain observation if it is the 24th observation starting at the fifth one, the following formula is not working. How should I alter it?
gen flag=0
forvalue 1/$N{
replace flag=1 if (obs==_n+5+_n*29)
}
Kind regards
Related Posts with flag certain observation
Conditional time formula help Hi, I have the following panel data and I need to generate conditional new variables that equal …
Staggered diff in diffHey everyone, I will be evaluation a policy consisting on granting property rights to communities, …
Add pseudo R2 in probit with marginal effectsHello Stata legends, I've been searching on statalist for a while, but I can't seem to figure out m…
Panel Data ProbabilitiesHello, I have panel data looking like the following: Code: * Example generated by -dataex-. For m…
Using egen to create new treatment variableHi, I am looking at a study involving student performance and gender. Students are observed taking …
Subscribe to:
Post Comments (Atom)
0 Response to flag certain observation
Post a Comment