Dear Stata Experts,
I have a problem with importing data from Excel.
A bunch of variables I have are refer to virus genotypes, so they were entered as numbers. When I choose the option “firstrow”, because Stata does not accept variables starting with a number, it resorts to changing names of variables to the column they correspond to on the spreadsheet. For example, if the column G on Excel has a variable called 157, Stata would import it as variable “G” with a label of “157.”
Changing that for a variable or two is not a problem, but when you have to do it for hundreds of columns it becomes tedious. What I want to do is somehow import these columns and add a letter or two before them. In other words, import variable 157 as b_157 to get around the no-number-policy Stata has!
Any help is much appreciated!
I have a problem with importing data from Excel.
A bunch of variables I have are refer to virus genotypes, so they were entered as numbers. When I choose the option “firstrow”, because Stata does not accept variables starting with a number, it resorts to changing names of variables to the column they correspond to on the spreadsheet. For example, if the column G on Excel has a variable called 157, Stata would import it as variable “G” with a label of “157.”
Changing that for a variable or two is not a problem, but when you have to do it for hundreds of columns it becomes tedious. What I want to do is somehow import these columns and add a letter or two before them. In other words, import variable 157 as b_157 to get around the no-number-policy Stata has!
Any help is much appreciated!
Comment