Since the majority of the datapoints are actually numeric rather than
alpha-numeric...is there a way for me to modify the 11 variable (dxcodes
and procodes) from string to numeric and then modify the alpha-numeric
datapoints within that variable to be read as either a string or numeric
(I don't care which as long as it can be read)... and as the other
gentlemen had stated - it's probably best to retain the code as is
rather than drop the dashes and alphabets.
Per my previous message, if you look closely at what encode is doing,
you will see that it does what you need. encode makes a string variable
into a numeric variable with string value labels. Thus the variable can
be displayed by its original contents, just as the variable foreign in
auto.dta appears to have string content--but it also can be used in
routines which require a numeric representation (such as anova or
regress). So read the variables that have both pure numeric and
alphanumeric values as strings--that is the only way that all of their
contents can possibly be retained within Stata--and encode them. That's
all it takes. They cannot be 'modified from string to numeric' without
destroying the alphanumeric content.