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

Re: st: how to recover data saved with tabstat ?


From   Giulio Rizzoli <[email protected]>
To   [email protected]
Subject   Re: st: how to recover data saved with tabstat ?
Date   Sun, 12 Dec 2004 13:40:47 +0100

At 14:14 11/12/2004, you wrote:
In aggiunta alla email precedente, volendo usare tabstat, un modo pu� essere questo

gen group2 = .
gen proportion2 = .

qui tab trunk
local N = r(r)

tabstat trunk foreign , by(trunk) stat(mean) save

forv i = 1(1)`N' {
mat M = r(Stat`i')
scalar name = M[1,1]
scalar prop = M[1,2]
qui replace group2 = scalar(name) in `i'
qui replace proportion2 = scalar(prop) in `i'
}

l group* proportion* if group in 1/18
Many thanks to Orsini Coviello and Baum for their rapid response and many solutions.
Orsini's solution recorded above was the one I was really interested in: It shows how to read in useful variables the results saved in r( ) by tab program, a useful piece of information that is missing in the help of the return command.
Thank you all again
Giulio Rizzoli
Giulio Rizzoli MD FETCS
Cardiochirurgia Padova
tel. 049 821-2408
fax 049 821-2409
e-mail [email protected]
web: http.//web.tiscali.it/grizzoli


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