String Variable

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

String Variable

This post has NOT been accepted by the mailing list yet.
Hello, I'm a new user of STATA.

I would like to generate a new variable if a concatenated string variable contains the character I want.


observation            string variable
1                          ABC
2                          BC
3                          AC
4                          AFC
5                          A

I would like to create a new variable for observations where the string variable contains the letter A (its position in the string variable is irrelevant).

Please help, thank you!