Hello to everyone!
I am very new to Stata and I am struggling with a problem, which I cannot solve so far. I have three dummy variables: group 1, group 2 and group 3
I am trying to find a way to sum the frequencies of all groups if they take the value 0 or 1.
For example I want to get totalzero=3.800 + 1.366 + 1.500 and totalone = 261 + 2.008 + 2.561
. tab1 group1 group2 group3
-> tabulation of group1
group1 | Freq. Percent Cum.
----------------------------------------------
0 | 3,800 93.57 93.57
1 | 261 6.43 100.00
-----------------------------------------------
Total | 4,061 100.00
-> tabulation of group2
group2 | Freq. Percent Cum.
-----------------------------------------------
0 | 1,366 40.49 40.49
1 | 2,008 59.51 100.00
-----------------------------------------------
Total | 3,374 100.00
-> tabulation of group3
group3 | Freq. Percent Cum.
-----------------------------------------------
0 | 1,500 36.94 36.94
1 | 2,561 63.06 100.00
-----------------------------------------------
Total | 4,061 100.00
Could you please explain to me what can I do? I tried to add the 3 dummy variables first but it doesnt give me the sum of frequencies.
Thank you very much in advance!!!
Related Posts with Adding frequencies conditional on several variables
Set baseline category of date variableI want to set the baseline category of a date variable. I thought of using fvset, see below. It does…
Multiple imputation estimate excluding some imputationsHi everyone, I would like to run the following code on my imputed dataset: Code: foreach var in $l…
Rank with a ConditionHello, I am stuck trying to rank a variable conditionally.....I understand rank is an egen function…
Help correlating between parameters across tasks and participantsHello everyone, This question may be rudimentary, however I haven't touched statistics for a very lo…
Difference between a classical DID and panel regression wrt interaction termDear Stata Members I have a question related to the interpretation and choosing the right model. Let…
Subscribe to:
Post Comments (Atom)
0 Response to Adding frequencies conditional on several variables
Post a Comment