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

st: total of a variable


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

Is there a way of collecting column total of variables and store in a .dta file. How can I modify the following code to do that?

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


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

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