Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

=?UTF-8?Q?R=C3=A9p.=20:=20Re:=20st:=20date=20format=20in=20-tabo?==?UTF-8?Q?ut-?=


From   "Herve STOLOWY" <[email protected]>
To   <[email protected]>
Subject   =?UTF-8?Q?R=C3=A9p.=20:=20Re:=20st:=20date=20format=20in=20-tabo?==?UTF-8?Q?ut-?=
Date   Wed, 23 Apr 2008 12:09:14 +0200

Dear Svend:

Thank you for reply. I did the following:

generate fyr2 = string(fyr,"%td")

It works but I now have a sorting problem. 

With the old fyr variable, dates are ordered chronologically. 

 tabulate  fyr country if (post_ifrs==0 | post_ifrs==1) & ib_scaled!=. & sample_sum==1 & year_ifrs==1

           |             country
       fyr |       AUS        FRA        GBR |     Total
-----------+---------------------------------+----------
 31 Mar 05 |         0          1          0 |         1 
 30 Jun 05 |         1          2          0 |         3 
 30 Sep 05 |         0          1          0 |         1 
 30 Dec 05 |         0          0          2 |         2 
 31 Dec 05 |        56        267        171 |       494 
 01 Jan 06 |         0          0          3 |         3 
 04 Jan 06 |         0          0          1 |         1 

With the new fyr2 variable, dates are ordered "alphabetically": 

tabulate  fyr2 country if (post_ifrs==0 | post_ifrs==1) & ib_scaled!=. & sample_sum==1 & year_ifrs==1

           |             country
      fyr2 |       AUS        FRA        GBR |     Total
-----------+---------------------------------+----------
 01apr2006 |         0          0          9 |         9 
 01jan2006 |         0          0          3 |         3 
 01jul2006 |         1          0          2 |         3 
 01oct2006 |         0          0          2 |         2 
 02apr2006 |         0          0          1 |         1 
 02jul2006 |         2          0          0 |         2 
 02mar2006 |         0          0          1 |         1 
 02sep2006 |         0          0          2 |         2 

(-tabout- now works fine with dates but I get the same "alphabetical" order).

Are we facing a dead end?

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
>>> Svend Juul <[email protected]> 23/04/08 11:26 >>>


(Resent; part of previous mail disappeared)

Herve wrote:

I tried to convert the date into string with:
tostring fyr, generate(fyr2)

but it does not work. I get a variable with numbers:

       +-------------------+
       |       fyr    fyr2 |
       |-------------------|
    1. | 30 Jun 01   15156 |
    2. | 30 Jun 02   15521 |
    3. | 30 Jun 03   15886 |
    4. | 31 Dec 04   16436 |
    5. | 31 Dec 05   16801 |

--------------------------------------------------------




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index