Hi dear Statalist:
I have a question. My dataset has 6764 subjects, from them 4142 have any disease; I have around 124 variables, and 42 variables that are each disease as dummy, for example cancer (0= no, 1=yes), arthritis (0= no, 1=yes) . The diseases are not exclusive. I would like to have a count of frequency of diseases by person. Example:
1 disease: 500 persons
2 diseases: 475 persons
3 diseases: 234 persons
Is there any way to count of the 42 diseases variables that are within the 142 variables? And to count the freqcuency of number of diseases in the dummy variables?
Best regards,
Related Posts with Counting diseases
Should I rename all the variables with the year immediately following the original variable names when I merge data across years with loopI run the following code: local i = 1998 while `i' < 2007{ local j=`i'+1 **step 10: match by …
Reporting weighted vs. unweighted data in descriptive analysisDear Stata Community: I am using a large nationally representative dataset where data is nested (ch…
Heckman selection model in three stagesDear Statalist, I hope you are well. Please, I would like to ask regarding the Heckman selection mod…
Tokenize and looping through tokensHi Statlist, I have the following problem. I have defined 3 local variables defining the path to so…
Issues with Lincom commandHello, I posted this question a few days ago, and I am trying to use the lincom command to find the …
Subscribe to:
Post Comments (Atom)
0 Response to Counting diseases
Post a Comment