Dear Statalisters,
I have a dataset with variables var_1:var_200 as well as a variable id that takes values 1:200 as well, so that the total dataset has 200 rows and 201 columns including the "id" variable.
Now I would like to sum first across all rows, and secondly across all but the first column (I could drop the first if necessary). How can I do that?
I've tried summing across the columns with "egen example = rowtotal()", but would need to type each of the 200 variables there? Or can I at least tell Stata more succintly to sum all of var_1 through var_200?
Thank you so much and best regards,
PM
I have a dataset with variables var_1:var_200 as well as a variable id that takes values 1:200 as well, so that the total dataset has 200 rows and 201 columns including the "id" variable.
Now I would like to sum first across all rows, and secondly across all but the first column (I could drop the first if necessary). How can I do that?
I've tried summing across the columns with "egen example = rowtotal()", but would need to type each of the 200 variables there? Or can I at least tell Stata more succintly to sum all of var_1 through var_200?
Thank you so much and best regards,
PM
Comment