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
Adding 2-Way Plot Options to User Written CommandsLet's say there's a command we're using to do some causal effect estimation. We run the command, and…
Converting R date into STATA dateHi, I am trying to convert R dates into STATA dates but unable to do so. For example, the R date i…
poisson regression with instrumental variables and high dimensional fixed effectsI have a poisson regression model with large number of fixed effects and an endogenous independent v…
Calculating difference between observations in a panel with missing valuesHello! I am working with online auction data (see -dataex- below), where id is the listing identifi…
Filling a number of missing variables sharing prefix with "replace"Hi Statalisters, I've merged two datasets which are cross-sectional(year of 2004) and time series(y…
Subscribe to:
Post Comments (Atom)
0 Response to Adding frequencies conditional on several variables
Post a Comment