Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: count cases of a string variable


From   "Tunga Kantarci" <[email protected]>
To   <[email protected]>
Subject   st: count cases of a string variable
Date   Thu, 1 May 2008 11:42:43 +0200

Hello,

I have a variable that has string values. I was trying to count cases with
the following command:

count if variablename == "string value"

which, however, returned me 0 cases.

Then I converted the variable to a numeric one and then the count worked.


After this two questions arise:

1.  Why the command -count if variablename == "string value"- did not work? 
What instead should I have used?

2. After I converted the variable, I command "describe", "tab", "sum"...
I only see in the "sum variablename" command the min and max values stata
has assigned but  
I don't see a complete list of assigned numeric values to string values. Why
and how can I see it?


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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