Wednesday, May 29, 2019

Creating variables that sum variables in regularly interspaced columns

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

No comments:

Post a Comment