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
PPML - generating a time dependent thresholdDear Stata community, I am working with a gravity model and what to cluster my observations dependi…
Using a loop to calculate new variableHello all, I want to find the new sale price for each year represented through new_sales. I will us…
Generating dummy observations to balance a panelI hope this request makes sense, as it is just to aid in my estimation. Below is the dataex of a dum…
Conditional loop analysis with sums in panel dataI have an unbalanced data of company id (i) country code (c) year (y) ratio-1 (r1) ratio-2 (r2) …
Determining the explanatory power of an interaction termHi everyone, I'm trying to fill a table with each line representing the explanatory power of a part…
Subscribe to:
Post Comments (Atom)
0 Response to flag certain observation
Post a Comment