(Don't speak english, Hope you can understand) Hi, I was wondering if is possible making a loop to fill a serie, for example:
set obs 10
foreach x in "Enero" "Febrero" "Marzo"{
gen mes_`x'=`x
'}
And get
mes_Enero filled with all the observations with Enero
mes_Febrero filled with all the observations with Febrero
the same with "Marzo"
Name the series is possible, the problem is about the observations.
Really need the help
Thank u
Related Posts with Foreach and gen ? Help please
Collapsing milliseconds data in secondsHi, i have a question in collapsing data. In the data sample below the header is the timestamp in mi…
Stata data manipulation filtering, summing and removing duplicates from quarterly observation dataHello dear Statalist, I am quite new with Stata and I could really need help for my thesis. I have…
Creating a prioritised ethnicity group variableHi all I have hospital admissions data, organised so each observation is an admission. There is a v…
Local projections impulse responde by country groupIn the following example by Oscar Jorda, I want to add impulse responses by different groups of coun…
Growth rates from Panel dataset.Hi Statalist, I have a panel dataset (monthly survey responses) which is defined by a firm id varia…
Subscribe to:
Post Comments (Atom)
0 Response to Foreach and gen ? Help please
Post a Comment