(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
How can I handle "id: maxvar too small" in Bayesian binary item response theory model using bayesmhPlease house I need help on this, I have gone through manual, blog stata and past statalist post. Th…
Equation not found after gsem + ImputationDear all, using Stata 15.1, I want to run a gsem model after Multiple Imputation. First I impute usi…
Store regression results of a loop in a new datasetHello everybody, I am new in this forum and I hope that I will get some advice from you. I would l…
Extracting model fit for a pre-specified logistic model.Hi all, I want to establish a (logistic regression) model with regards to disease relapse within th…
Collapse dataHi, Having monthly panel data, I want to convert from monthly to quarterly. Used these following op…
Subscribe to:
Post Comments (Atom)
0 Response to Foreach and gen ? Help please
Post a Comment