Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: column total


From   "Rajiv Mallick" <[email protected]>
To   [email protected]
Subject   st: column total
Date   Tue, 21 Jan 2003 16:15:57 -0600

The following code gives me means of the variables. How can I modify the following code to obtain column total of variables Price1 Price2 and Price3?

OR is there a better way of collecting column total of variables and store in a .dta file.

If you want to verify, the column totals are 456229.018, 1576.0002, 221.499982 for Price1 Price2 and Price3.

Thank you all for your suggestions.
Rajiv

code
-----------
clear
use "D:\Stata\auto.dta", clear
rename price price1
rename mpg price2
rename headroom price3
local vars price1 price2 price3

postfile temp_res m1 m2 using "e:\clm\data\temp_res.dta",double replace

foreach v of local vars {
qui summ `v',detail
post temp_res (r(mean))
}
postclose temp_res
clear
--------------------
end of code


Rajiv Mallick
504 818 0204




_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail

*
* 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