Hi, I would like to create a formula for making variables of the kind:
gen newvar = v[k] + v[k+8] + v[k+16] + v[k+24] + v[k+32]
where I will specify the k.
Any idea how I can execute this?
Thanks
Related Posts with Creating variables that sum variables in regularly interspaced columns
Ttest with categorical varaiblesHI, I wanted to know if it is possible to run ttests in order to calculate the difference between th…
How to use global macros inside conditional statementsHi guys, I'm encountered a syntax problem that should be easy to solve but I still can't nail how to…
Dropping variable and saving itHi everyone How can I Remove a variable from a dataset, but save it in such a way that you can mer…
Regression TreeDear Users Does anyone have an experience with regression trees in stata, and how the CaRT package w…
Is it possible to specify a different color only for the negative bar?Hello, I want to change the different colors on the negative bar in my graph. Code: input year …
Subscribe to:
Post Comments (Atom)
0 Response to Creating variables that sum variables in regularly interspaced columns
Post a Comment