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

Re: st: geometric mean saved results


From   JLGreig <jlgreig@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: geometric mean saved results
Date   Wed, 18 Sep 2002 13:34:06 -0700 (PDT)

sorry, the email I wrote, but not my program has those
quotes, and I still get an error message while the
program reads:

capture program drop taball
program define taball
	while "`1'" ~="" {
	use database1, clear
	keep if gender==1
	display "ranksum GEOMETRIC MEAN fp3 by `1' "
	sort `1'
	quietly means fp3
	local gmeanfp3 = r(mean_g)
        ranksum `gmeanfp3' if `1'~=9999, by(`1')
		mac shift
	}
end
taball var1 var2

with the error, "time series operators not allowed",
even when the [if `1'~=9999] is removed...

...so I'm still stuck and think that I can't do it in
STATA, but am open to ideas.



--- Russell Dimond <rdimond@ssc.wisc.edu> wrote:
> There may well be other issues here, but the
> immediate problem is easy to 
> solve. Just take the quotes out of the definition of
> gmeanfp3:
> 
> local gmeanfp3= r(mean_g)
> 
> Otherwise gmeanfp3 is replaced by its value prior to
> this line, which is 
> nothing. So Stata sees
> 
> local = r(mean_g)
> 
> and gives error message you describe. Hope this
> helps.
> 
> 
> Russell
> 
> At 09:49 AM 9/18/2002 -0700, you wrote:
> >Subject: st: geometric mean saved results
> >To: statalist@hsphsun2.harvard.edu
> >
> >I'm having a great deal of difficulty trying to do
> >anovas, ranksums, regressions, etc. on the
> geometric
> >mean of a continuous variable--just capturing the
> >saved results following a means command ofcourse
> does
> >not work, as below with ranksum:
> >
> >.quietly means fp3
> >.local `gmeanfp3' = r(mean_g)
> >.ranksum `gmeanfp3' if `1'~=9999, by(`1')
> >
> >which gives me an error message of "_= invalid
> name".
> >
> >Any suggestions at all would be much appreciated.
> 
> *
> *   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/


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index