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
Generate a variable based on id number and its chosen indicatorDear Stata users, I encounter this question when using one-to-one matching. The variable id is numb…
replacing missing with non-missing within the same variableBelow is an example of the dataset (for some reason the columns are not lining up with the variables…
How to select/specify variables to include in a table with descriptive statistics?Dear Stata Users, I run the following code to generate a table: Code: unab stubs : *_X local st…
Errors using random slope on dummy variableHello, Thank you for reading my post. I am seeking advice about the following problem: I am estimat…
Collinearity with long-run averageHi, I am creating a long-run average of crime rates disaggregated which are reported at the distric…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variables that sum variables in regularly interspaced columns
Post a Comment