Hi,
I have been looking for a way to count the occurrence of a character in a variable, but have only found this https://www.stata.com/statalist/arch.../msg01131.html that does really answer my question.
I have a sting variable (Disease) with a certain amount of ",". I would need to create a variable (Comas) that counts the number of "," for each value. How would you go about this?
Thanks.
Best regards
Antonio
I have been looking for a way to count the occurrence of a character in a variable, but have only found this https://www.stata.com/statalist/arch.../msg01131.html that does really answer my question.
I have a sting variable (Disease) with a certain amount of ",". I would need to create a variable (Comas) that counts the number of "," for each value. How would you go about this?
Thanks.
Best regards
Antonio
Comment