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
Percentage explained by the standard deviation of linear combination of independent variablesHello, everyone, I have a question about using standard deviation to explain changes in the dependen…
Predict residuals after running a FE / RE modelHow can residual centering be done after running a panel data regression? It can be done easily aft…
Using margins command after medeffHi all, I used medeff comand to see mediation effects. Because my outcome variable and mediator var…
gologit2 with autofit is too slow. Is there any alternative?I'm running a regression which has life satisfaction (measured in a 1-10 scale) as a dependent varia…
What to do when a scatter plot shows no association with variables that are clearly associated?Hello, I have just started using Stata for my econometrics course. I am trying to build an OLS mode…
Subscribe to:
Post Comments (Atom)
0 Response to flag certain observation
Post a Comment