Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: String Variable

From   yj <>
Subject   st: String Variable
Date   Wed, 8 Jun 2011 07:08:01 -0700 (PDT)

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

Please help, thank you!

View this message in context:
Sent from the Statalist mailing list archive at
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index