Statalist


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

st: RE: AW: Test of the difference in growth rate of two variables


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: AW: Test of the difference in growth rate of two variables
Date   Fri, 24 Apr 2009 17:38:36 +0100

More important than any assumption about marginal distributions is what is tacitly assumed here about independence of error terms. If the model of growth fitted isn't right for the data, then the errors will probably be correlated, and that may happen any way. There's no guarantee here that the P-values emitted by -ttest- will be credible without extra checks that the underlying assumptions are valid. 

The more general point, I would contend, is that Herve needs an explicit model of growth for inferences to make any sense. There is no plug-in procedure otherwise. There is a dependence structure lurking behind his data -- what he is doing makes no sense if that's not true -- and it's got to be modelled properly. There's no free lunch. 

Nick 
n.j.cox@durham.ac.uk 

Martin Weiss

Maybe like this for the 5 year thing. -ttest- assumes normality, AFAIK...

clear
set obs 1344

gen number=_n  
expand 5
sort number
egen year=seq(), from(2001) to(2005)

bys number:gen var1=rnormal()+(_n*5)
bys number:gen var2=rnormal()+(_n*10)

collapse (first) firvar1=var1 (first) firvar2=var2 ///
(last) lavar1=var1 (last) lavar2=var2, by(number)
gen growthvar1= lavar1/ firvar1-1
gen growthvar2= lavar2/ firvar2-1

ttest growthvar1 == growthvar2, unpaired unequal welch

Herve STOLOWY

I have two variables V1 and V2 for 5 years: 2001, 2002, 2003, 2004 and
2005 (in total 1344 observations).

My assumption is that the growth rate of V1 over the period (from 2001
to 2005) is higher than the growth rate of V2.

Do you know a statistical tool to test this difference in growth rates?
I would also like to make this test for several periods (for example
over one year from 2003 to 2004, or over two years, etc.).


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index