Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
Nick Cox <njcoxstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Descriptive statistics - counting aspects of a variable |

Date |
Sun, 3 Jun 2012 16:06:33 +0100 |

I agree with Abhimanyu. Also if -XX- is a string variable, then count if XX == 616 won't work. You need "616". Nick On Sun, Jun 3, 2012 at 3:55 PM, Abhimanyu Arora <abhimanyu.arora1987@gmail.com> wrote: > I guess you have to type in > count if XX=="618A" > since it is a string variable > PS-Frankly, the phrase "stata not being able to tell" without the > displayed output might be a bit hazy for users like me On Sun, Jun 3, 2012 at 4:24 PM, Amal Khanolkar <Amal.Khanolkar@ki.se> wrote: >> I have a variable XX that describes various diagnoses that my subjects might have. Diagnoses are coded using the usual ICD 8-10 codes. While most diagnoses are just numerical, some end with an alphabet, for e.g. 618A or 720H. >> >> I can ask Stata to tell me how many subjects in my dataset have diagnoses 618 by: >> >> count if XX==616 >> >> However how do I find out how many have a diagnoses with numbers in combination with letters (like 618A). Stata isn't able to tell me using the 'count' or 'sum' commands as above. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: Descriptive statistics - counting aspects of a variable***From:*Amal Khanolkar <Amal.Khanolkar@ki.se>

**Re: st: Descriptive statistics - counting aspects of a variable***From:*Abhimanyu Arora <abhimanyu.arora1987@gmail.com>

- Prev by Date:
**Re: st: Descriptive statistics - counting aspects of a variable** - Next by Date:
**Re: st: Descriptive statistics - counting aspects of a variable** - Previous by thread:
**Re: st: Descriptive statistics - counting aspects of a variable** - Next by thread:
**Re: st: Descriptive statistics - counting aspects of a variable** - Index(es):