I am trying to summarise a categorical variable in stata that has been asked repeatedly in a cohort study. I would like to pool the results for posseting for these three months, i.e. the never category at each of the time points would be added, as would each of the other categories. I’m after a new variable that represents the distribution of posseting in these categories for the three months combined. None of the various egen commands do what I require and whilst I suspect that there may be a straight forward solution I have not been able to deduce what this is so far.
Many thanks,
Michael
. tab tcposset_q4m
posseted since |
3m visit | Freq. Percent Cum.
-----------------+-----------------------------------
never | 94 7.83 7.83
monthly or less | 103 8.58 16.42
weekly | 107 8.92 25.33
2-4 times a week | 185 15.42 40.75
5-6 times a week | 109 9.08 49.83
daily | 230 19.17 69.00
more than daily | 372 31.00 100.00
-----------------+-----------------------------------
Total | 1,200 100.00
. tab tcposset_q5m
posseted since |
3m visit | Freq. Percent Cum.
-----------------+-----------------------------------
never | 117 10.07 10.07
monthly or less | 96 8.26 18.33
weekly | 134 11.53 29.86
2-4 times a week | 209 17.99 47.85
5-6 times a week | 102 8.78 56.63
daily | 214 18.42 75.04
more than daily | 290 24.96 100.00
-----------------+-----------------------------------
Total | 1,162 100.00
. tab tcposset_q6m
posseted since |
3m visit | Freq. Percent Cum.
-----------------+-----------------------------------
never | 174 15.30 15.30
monthly or less | 160 14.07 29.38
weekly | 171 15.04 44.42
2-4 times a week | 194 17.06 61.48
5-6 times a week | 96 8.44 69.92
daily | 178 15.66 85.58
more than daily | 164 14.42 100.00
-----------------+-----------------------------------
Total | 1,137 100.00
I would like to pool the results for posseting for these three months, i.e. the never category at each of the time points would be added, as would each of the other categories. I’m after a new variable that represents the distribution of posseting in these categories for the three months combined. Does this make sense?!
Many thanks,
Michael
. tab tcposset_q4m
posseted since |
3m visit | Freq. Percent Cum.
-----------------+-----------------------------------
never | 94 7.83 7.83
monthly or less | 103 8.58 16.42
weekly | 107 8.92 25.33
2-4 times a week | 185 15.42 40.75
5-6 times a week | 109 9.08 49.83
daily | 230 19.17 69.00
more than daily | 372 31.00 100.00
-----------------+-----------------------------------
Total | 1,200 100.00
. tab tcposset_q5m
posseted since |
3m visit | Freq. Percent Cum.
-----------------+-----------------------------------
never | 117 10.07 10.07
monthly or less | 96 8.26 18.33
weekly | 134 11.53 29.86
2-4 times a week | 209 17.99 47.85
5-6 times a week | 102 8.78 56.63
daily | 214 18.42 75.04
more than daily | 290 24.96 100.00
-----------------+-----------------------------------
Total | 1,162 100.00
. tab tcposset_q6m
posseted since |
3m visit | Freq. Percent Cum.
-----------------+-----------------------------------
never | 174 15.30 15.30
monthly or less | 160 14.07 29.38
weekly | 171 15.04 44.42
2-4 times a week | 194 17.06 61.48
5-6 times a week | 96 8.44 69.92
daily | 178 15.66 85.58
more than daily | 164 14.42 100.00
-----------------+-----------------------------------
Total | 1,137 100.00
I would like to pool the results for posseting for these three months, i.e. the never category at each of the time points would be added, as would each of the other categories. I’m after a new variable that represents the distribution of posseting in these categories for the three months combined. Does this make sense?!
Comment