Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: exit variable in opreg by Yasar, Raciborski, Poi (2008)


From   Michel Serafinelli <serafine@econ.berkeley.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: exit variable in opreg by Yasar, Raciborski, Poi (2008)
Date   Thu, 1 Mar 2012 20:46:59 -0800

Dear statalist members,

I want to use the opreg routine by Yasar, Raciborski, Poi (2008)
“Production function estimation in Stata using the Olley and Pakes
method” (YRP)

 In this routine exit is a dummy with 1 indicating the firm exited in
the current period.

at pag 227 of their article, YRP show the commands on how to construct
the exit variable.

However this does not seem to work for me.

I copy the log file below in which I also list the first 30
observations in the dataset. You can see for instance in the
observation 16 and 28 of the dataset the variable exit takes value 1
even if the firm is not exiting.

Please let me know if you have any suggestion, thanks!

Best,

Michel


. xtset tax_code year
       panel variable:  tax_code (unbalanced)
        time variable:  year, 1995 to 2001, but with gaps
                delta:  1 unit

. rename tax_code firmid_op

. sort firmid_op year

. by firmid_op: gen count = _N

. * my dataset is for the period 95-2001 while YRP have data for 95-2002
. gen survivor = count == 7

. gen has95 = 1 if year == 2001
(14464 missing values generated)

. sort firmid_op has95

. by firmid_op: replace has95 = 1 if has95[_n-1] == 1
(10848 real changes made)

. replace has95 = 0 if has95 == .
(3616 real changes made)

. sort firmid_op year

. by firmid_op: gen has_gaps = 1 if year[_n-1] != year-1 & _n != 1
(16414 missing values generated)

. sort firmid_op has_gaps

. by firmid_op: replace has_gaps = 1 if has_gaps[_n-1] == 1
(1921 real changes made)

. replace has_gaps = 0 if has_gaps == .
(14493 real changes made)

. by firmid_op: generate exit = survivor == 0 & has95 == 0 & has_gaps
!= 1 & _n == _N

. replace exit = 0 if exit == 1 & year == 2001
(0 real changes made)

. * now we can see that this is not working
. xtset firmid_op year
       panel variable:  firmid_op (unbalanced)
        time variable:  year, 1995 to 2001, but with gaps
                delta:  1 unit

. *note: matr_az is the string variable corresponding to the
identifier "tax_code/firmid_op" (1:1 relantionship between the two)
. list in 1/30

     +----------------------------------------------------------------------------+
     | year      matr_az   firmid_op   count   survivor   has95
has_gaps   exit |
     |----------------------------------------------------------------------------|
  1. | 1995   1000009303   1.000e+09       7          1       1
  0      0 |
  2. | 1996   1000009303   1.000e+09       7          1       1
  0      0 |
  3. | 1997   1000009303   1.000e+09       7          1       1
  0      0 |
  4. | 1998   1000009303   1.000e+09       7          1       1
  0      0 |
  5. | 1999   1000009303   1.000e+09       7          1       1
  0      0 |
     |----------------------------------------------------------------------------|
  6. | 2000   1000009303   1.000e+09       7          1       1
  0      0 |
  7. | 2001   1000009303   1.000e+09       7          1       1
  0      0 |
  8. | 1996   1000022830   1.000e+09       6          0       1
  0      0 |
  9. | 1997   1000022830   1.000e+09       6          0       1
  0      0 |
 10. | 1998   1000022830   1.000e+09       6          0       1
  0      0 |
     |----------------------------------------------------------------------------|
 11. | 1999   1000022830   1.000e+09       6          0       1
  0      0 |
 12. | 2000   1000022830   1.000e+09       6          0       1
  0      0 |
 13. | 2001   1000022830   1.000e+09       6          0       1
  0      0 |
 14. | 1995   1000028092   1.000e+09       6          0       0
  0      0 |
 15. | 1996   1000028092   1.000e+09       6          0       0
  0      0 |
     |----------------------------------------------------------------------------|
 16. | 1997   1000028092   1.000e+09       6          0       0
  0      1 |
 17. | 1998   1000028092   1.000e+09       6          0       0
  0      0 |
 18. | 1999   1000028092   1.000e+09       6          0       0
  0      0 |
 19. | 2000   1000028092   1.000e+09       6          0       0
  0      0 |
 20. | 1995   1000035962   1.000e+09       7          1       1
  0      0 |
     |----------------------------------------------------------------------------|
 21. | 1996   1000035962   1.000e+09       7          1       1
  0      0 |
 22. | 1997   1000035962   1.000e+09       7          1       1
  0      0 |
 23. | 1998   1000035962   1.000e+09       7          1       1
  0      0 |
 24. | 1999   1000035962   1.000e+09       7          1       1
  0      0 |
 25. | 2000   1000035962   1.000e+09       7          1       1
  0      0 |
     |----------------------------------------------------------------------------|
 26. | 2001   1000035962   1.000e+09       7          1       1
  0      0 |
 27. | 1996   1000039407   1.000e+09       3          0       0
  0      0 |
 28. | 1997   1000039407   1.000e+09       3          0       0
  0      1 |
 29. | 1998   1000039407   1.000e+09       3          0       0
  0      0 |

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