Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Count Special Character

From   "Kang, Eugene" <>
To   <>
Subject   st: Count Special Character
Date   Sat, 26 Feb 2005 15:03:41 -0600


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!!

Eugene Kang

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index