(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
Imposing two parameter entries are equal in impact matrix for the SVAR commandI am trying to specify an IS curve in my impact matrix for my structural var. In my structural VAR, …
r601 error - file C:\Users\admin\AppData\Local\Temp\ST_aef0_000002.t mp not found r(601);I'm try to run the code shown below. The app geocode was down loaded from the internet. I'm running …
Retrieve the numeric value of a labelI have a string variable nation2 distributed as follows: Code: . tab nation2, m nation2 | …
using nlcom to calculate combinations of parameter estimates from different modelsDear Stata users, I am estimating two mixed logit models: (1) mixlogit choice price1, group(idgrou…
Adding auxiliary variables in a modelGreetings, I am new to STATA. I would like to ask how to insert auxiliary variables in one of my st…
Subscribe to:
Post Comments (Atom)
0 Response to Foreach and gen ? Help please
Post a Comment