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: How do I make frequencies for combined variables?


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: How do I make frequencies for combined variables?
Date   Wed, 26 Jun 2013 16:36:57 -0400

" need the frequency of each of them them of combination of two then
the three of them."
this will be a lot of combinations for 12 symptoms: 2^12 if I am not
mistaken? 4096
Perhaps listing just the combinations that occur in your data would
suffice? The rest you would know are zeroes.
See below for a starter.

Best, Sergiy Radyakin


sysuse auto, clear

gen s1=(mpg>16)
gen s2=(mpg>20)
gen s3=s2|foreign
gen s4=price<5000&!foreign

local symptoms "s1 s2 s3 s4"

egen sg=group(`symptoms')
tabulate sg
keep sg `symptoms'
sort sg
preserve
quietly by sg : keep if _n==1
list sg `symptoms', clean noobs
restore


On Wed, Jun 26, 2013 at 4:08 PM, Edouard Betsem <[email protected]> wrote:
> Dear Statalisters,
> I am new in Stata and currently working on symptoms combinations for a
> specific disease.
> There are 12 symptoms that can be found in combinations of 1 to 12 in
> different individuals (cases and controls)
> I would like to tell how frequent any combination is in disease negative
> individuals.
> I need to list specifically the symptoms in any combination and the
> frequency of that particular combination.
>
> If I consider fever, headache and cough,
> i need the frequency of each of them them of combination of two then the
> three of them.
> thank you for your great help
> Edouard
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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