Hello,
I'm starting to use stata and i wonder if there is a way to use the substr function or an other function in order to keep the first two letters of a modality of a variable but not to all the data. For example, if there's a variable "prescriber" with a lot of differents modality (Dr A, Dr B, hospital A, hospital B...) is it possible to cut the data in order to have : Dr, Dr, hospital, hospital... ?
Thanks for your help
I'm starting to use stata and i wonder if there is a way to use the substr function or an other function in order to keep the first two letters of a modality of a variable but not to all the data. For example, if there's a variable "prescriber" with a lot of differents modality (Dr A, Dr B, hospital A, hospital B...) is it possible to cut the data in order to have : Dr, Dr, hospital, hospital... ?
Thanks for your help
Comment