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
Loading Data from ODBC Data source in a loopDear Stata Forum, I have encountered this problem yesterday and I could not figure out how to do i…
Generate a time dummy pre - and post -treatment in panel dataHello everyone, I have a panel dataset covering US states and counties for a number of years and qua…
Plotting a graph of confidence intervals for interaction effectsHi, I have a regression with 3611 observations, over 720 fixed effect variables and 8 interaction t…
Test and train dataset: evaluate RMSE of my modelsuppose I run the following regression: Code: reghdfe y x1 x2 x3 if train == 1, abs(fe1 fe2) clu…
View full variable names in the browserIs there a way by which we can see full names of the variables in the data browser, without formatti…
Subscribe to:
Post Comments (Atom)
0 Response to Adding frequencies conditional on several variables
Post a Comment