[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Count Special Character
I would appreciate some help on the following problem.
I have a variable that captures individual names in my dataset. If there
is more than 1 individual, then the names are separated by a /. For
instance, there are 2 individuals if the variable shows
riedel/baysinger, while there are 3 individuals if the variable shows
I need to create a new variable that captures the number of individuals
for an observation. Does STATA allow me to count the number of / in a
variable? In the above example, 1 / would indicate 2 individuals for
that observation, while 2 / will indicate 3 individuals, and so on. I
could count the number of / manually, but I have close to 20,000
observations in the dataset!!
* For searches and help try: