I want to replicate this code up to stateid==32; from 1 to 32. How can I do this without typing it out 32 times. Do a loop?
gen s1_trend = time if stateid==1
recode s1_trend .=0
gen s2_trend = time if stateid==2
recode s2_trend .=0
gen s3_trend = time if stateid==3
recode s3_trend .=0
Related Posts with Loop?
Pooled meta regression to estimate cross-country effects?Dear all, I have two questions relating to the -meta regress- command (Stata 17) and how to use it …
Reproducing "estat trendplots" linear-trends modelHello Statalist community, I am doing an analysis using a diff in diff methodology. As I use Stata …
How to adjust the colour of event plot ?When using the event_plot command, my code is Code: event_plot, alpha(0.01) default_look graph_opt…
How to get Durbin-Watson stat in GMM regressions?Dear statalist, I am running GMM regressions with robust HAC matrix and standard errors and I would…
help in generating count variableI am working on World Value Survey dataset. It consists of 5 waves and multiple countries in each wa…
Subscribe to:
Post Comments (Atom)
0 Response to Loop?
Post a Comment