Hi!
I'm trying to add a "total" row to a data frame such that it corresponds to the sum of all my groups' observations (similar issue to https://www.statalist.org/forums/for...sting-variable).
I would like to use the method that is shown in this already solved topic, but for now I don't see how using either tabdisp or tag will help me to generate this new total row.
In short, considering this code :
sysuse auto, clear
collapse(sum) price, by(foreign)
How do I add a third row that shows "total" for the foreign variable and the sum of the two figures above for the price variable ?
Many thanks !
Baptiste
Related Posts with Collapse by groups : add a total row
Time trend in xtunitroot ht testHi everyone, I run the Harris-Tzavalis unit-root test with time trend as follows: xtunitroot ht in…
Problem with multigroup SEMHello, I'd like to know what is the code for estimating the indirect effects in multigroup SEM. Fo…
Dunn Test Median Comparison Error ?I might be doing this wrong but I named my groups numbers, so "7", "8" and "9" are separate groups. …
Labelling variable based on existing label of another variableHello, I was wondering if there is a command that enables you to label a variable based on an exist…
Dunn Test Bonferroni Correction gives p-value of 1. Error?I did the Dunn test using the following code: Code: dunntest rating, by(outcome) ma(bonferroni) I …
Subscribe to:
Post Comments (Atom)
0 Response to Collapse by groups : add a total row
Post a Comment