(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
testing for serial correlation in residuals of fixed effects model (xtqptest on reghdfe)I want to test for first order serial correlation in the residuals of this Stata regression model: …
Multiple imputation for handling missing data in multiple covariatesDear All, While adapting multiple imputation in longitudinal datasets to handle missing data in mul…
Plot different variables in panel dataDear all I want to plot two different variables in my panel data and merge it in one graph Such as …
Displaying a Complex TableGood morning everyone! I'm quite new to STATA and try to display a complex table, but even after ho…
Generating observation in statahey all, Can anyone help me to generate 1000 observation of the F distribution with parameters diffe…
Subscribe to:
Post Comments (Atom)
0 Response to Foreach and gen ? Help please
Post a Comment