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

# Rép. : st: AW: Test of the difference in growth rate of two variables

 From "Herve STOLOWY" To Subject Rép. : st: AW: Test of the difference in growth rate of two variables Date Fri, 24 Apr 2009 18:50:35 +0200

```Dear Martin:

Thank you for your reply. I tried your program and am not sure to
understand the necessity of the -collapse-.

Following on your example, if I do:

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)

su  var1 if year==2001
su  var1 if year==2002
su  var1 if year==2003
su  var1 if year==2004
su  var1 if year==2005

I see that there is an increase in the mean of var1 (what I call the
growth rate).

If I do the same with var2

su  var2 if year==2001
su  var2 if year==2002
su  var2 if year==2003
su  var2 if year==2004
su  var2 if year==2005

I will also have a growth rate.

I want to compare  both growth rates.

Best regards

Herve

***********************************************************
Professeur/Professor
President of the French Accounting Association (AFC)
HEC Paris
Departement Comptabilite Controle de gestion / Dept of Accounting and
Management Control
1, rue de la Liberation
78351 - Jouy-en-Josas
France
Tel: +33 1 39 67 94 42 - Fax: +33 1 39 67 70 86
mail: stolowy at hec dot fr
web: http://www.hec.fr/stolowy
>>> "Martin Weiss" <martin.weiss1@gmx.de> 24/04/09 18:28 >>>

<>

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/

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