Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: Test of differences between geometric means


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: RE: Test of differences between geometric means
Date   Tue, 15 Nov 2011 18:31:25 +0000

The majority of user-written programs were written because the programmers wanted to use them themselves. So, you may need to write what you want to use. Meanwhile here is one sketch. 

*! 0.1.0 NJC 15 Nov 2011
program geomsu, rclass  
	version 9 
	syntax varname(numeric) [if] [in] 
	marksample touse 
	
	qui count if `touse' 
	if r(N) == 0 error 2000 
	
	qui count if `touse' & `varlist' <= 0 
        if r(N) > 0 error 411 
	
	quietly { 	
		tempvar work 
		gen `work' = log(`varlist') if `touse' 
		su `work'
	
		local fmt : format `varlist' 
	}

	di 	
	di "geometric mean  " `fmt' exp(r(mean)) 
	di "geometric SD    " `fmt' exp(r(sd)) 
	
	return scalar gmean = exp(r(mean))
	return scalar gsd = exp(r(sd)) 
end 
	
Nick 
[email protected] 

Junlin Liao

I'm wondering if someone could write a procedure to summarize
lognormal data automatically in the form of geometric mean and std
etc. It's easy to transform data to get the results, but it would be
nice if it's automated. The means commands (gmeans or ameans) do not
give standard deviation.

On Tue, Nov 15, 2011 at 3:41 AM, Nick Cox <[email protected]> wrote:

> There is I believe some literature on ad hoc tests for this question, but the results of
>
> . findit lognormal
>
> do not show any Stata implementations. I'd recast the problem as one of estimating a model using either -glm, link(log) f(normal)- or -lognfit- (SSC).
>
> Nick
> [email protected]
>
> [email protected]
>
> Is there a test of differences between geometric means, assuming lognormal distributions?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index