Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Sums and means within a table


From   "Todd Swarthout" <[email protected]>
To   <[email protected]>
Subject   RE: st: Sums and means within a table
Date   Thu, 18 Jan 2007 15:14:26 +0100

No, you understood perfectly and your suggestion worked perfectly. 

Again, 

Thank you 

-----Message d'origine-----
De : [email protected] [mailto:[email protected]] De la part de Nick Cox
Envoy� : jeudi 18 janvier 2007 14:56
� : [email protected]
Objet : RE: st: Sums and means within a table

In Stata, as in much else, subtraction is obtained with minus -.

Thus 

gen y = x - z 

gives the difference between x and z after which you can -tabulate- y. 

Forgive me if I misunderstand your question, but this does appear to be what you are asking. 

On the other hand, if this really is what you are asking, it is something you should be able to work out for yourself from the documentation or simple introductions to Stata. 

Nick
[email protected] 

Todd Swarthout
 
> Another simple query
> 
> I have two variables 'q28income' and 'q27expenses.' 
> 
> The command 'tab q28income' gives the following table (I print only a 
> part)
> 
> tab q28income
>  q28income |      Freq.     Percent        Cum.
> ------------+-----------------------------------
>           0 |         72       24.00       24.00
>          10 |          1        0.33       24.33
>          25 |          4        1.33       25.67
>          30 |          1        0.33       26.00
>          40 |          3        1.00       27.00
> 
> This says, for example, there are 4 houses with a total weekly income 
> of 25 gourdes (Haiti).
> 
> The command 'tab q27expenses'gives a similar table.
> 
> Id like to have a command that will subtract the expenses from the 
> income variable...giving me a net value for the household.
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index