Bookmark and Share

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


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

Re: st: quick question


From   Austin Nichols <[email protected]>
To   [email protected]
Subject   Re: st: quick question
Date   Tue, 16 Feb 2010 18:03:44 -0500

Tony <[email protected]> :
There are many ways to go, and the optimal choice no doubt depends on
what you might want to do with the data later, but try e.g.

clear
input str15 other
"55.1"
"0"
"54.3"
"0"
"0"
"55.2"
"0"
"0"
"17.3;49.3"
end
g o=other if other!="0"
replace o=subinstr(o,";"," ",.)
g n=wordcount(o)
l, noo

On Tue, Feb 16, 2010 at 4:38 PM, Lachenbruch, Peter
<[email protected]> wrote:
> I have a list of multiple diagnoses (rashes) and the typical one is quite rare.  I decided to simply count the number of such diagnoses.  The data look like (in the first 50 observations)
>
>     +--------------------+
>     |         other_rash |
>     |--------------------|
>  10. |               55.1 |
>  11. |                  0 |
>  12. |               54.3 |
>  13. |                  0 |
>  14. |                  0 |
>     |--------------------|
>  15. |               55.2 |
>  16. |                  0 |
>  17. |                  0 |
>  18. |          17.3;49.3 |
>  19. |               55.2 |
>     |--------------------|
>  20. |          11.3;18.3 |
>  21. |                  0 |
>  22. |                  0 |
>  23. |                  0 |
>  24. |      9.2;11.3;17.3 |
> I would like to be able to count the number of other_rashes - I tried to find a string function that would do this count, I was unsuccessful.  Am I missing something?  It's not crucial as I've already done this manually, but I have several other variables to handle.

*
*   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/


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