Statalist


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

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


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: Test of the difference in growth rate of two variables
Date   Fri, 24 Apr 2009 18:28:19 +0200

<> 

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



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Herve STOLOWY
Gesendet: Freitag, 24. April 2009 18:04
An: statalist@hsphsun2.harvard.edu
Betreff: st: Test of the difference in growth rate of two variables

Dear Statalisters:

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.).

Best regards

Hervé Stolowy
*
*   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/


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