Hi all,
I wanr to create variables in a forval numeric forloop
forval i = -7(1)7{
gen dummy_`i' = 1 if dif>`i'-1 & dif<`i'+1
}
however this syntax is invalid. What can I do?
Thank you for your help!!
Related Posts with creating variables in forval numeric forloop
Create 2 new variables from existing variables: one date, and one with value equal to another variable's name Code: * Example generated by -dataex-. For more info, type help dataex clear input float(study_id r…
Why I got this error "independent variables are collinear with the panel variable id" when running the xtivreg?When running the code "xtivreg y (x = z) i.year##i.id, fe vce(cluster id)", I got this error "indepe…
Foreach Loops for excel graph exportI could not figure out how to delete this post but no longer need it …
coefplot subgraphs by coefficients: how to loop subgraphs?Hi Statalist, I was referring to the coefplot trying to make subgraphs like this (below are example…
Log4j vulnerability (CVE-2021-44228 and subsequent CVE-2021-45046)Thank you James Hassell (StataCorp) for placing a comment regarding the Log4j vulnerability in Stata…
Subscribe to:
Post Comments (Atom)
0 Response to creating variables in forval numeric forloop
Post a Comment