Hi all,
I'm using Stata 14.1. I have a number of data sets that I am trying to apply universal formatting to. Some data sets have 10 variables and some have say 8 or 9. What I want to do is insert a dummy variable (that can be blank) in order to bring the total number of variables up to 10 so that I can use a consistent formatting script across all data sets. I may have 20 data sets, so don't wish to open and close each data set. Is anyone aware of a way I can count the number of variables in the current data set and generate an extra variable if the total number is fewer than a set number?
Thanks
Tim
I'm using Stata 14.1. I have a number of data sets that I am trying to apply universal formatting to. Some data sets have 10 variables and some have say 8 or 9. What I want to do is insert a dummy variable (that can be blank) in order to bring the total number of variables up to 10 so that I can use a consistent formatting script across all data sets. I may have 20 data sets, so don't wish to open and close each data set. Is anyone aware of a way I can count the number of variables in the current data set and generate an extra variable if the total number is fewer than a set number?
Thanks
Tim
Comment