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
Reshaping data long to wide(NSS, 64th round)Hi, The data I am detailing with pertains to the household and individual-level data from the Natio…
Using value labels in graphs through loopsHi all, I am trying to create a graph of weekly_count_visittype (Y axis) and week_num (X axis) separ…
Calculating 95% CI for a chi square analysis?If I'm looking for how a category "treatment type" affects category "diagnosis" in a 2x2 chi square …
How to use the results of LCA(Latent Class Analysis) in the next step of regression analysis?Hello! I used gsem to perform an LCA analysis and separated the categories. How can I use this cate…
'SWEXP': piecewise exponential distribution functionI thank Kit for making a command swexp available on SSC. This command calculates quantities from a …
Subscribe to:
Post Comments (Atom)
0 Response to Creating variables that sum variables in regularly interspaced columns
Post a Comment