Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: st: exit variable in opreg by Yasar, Raciborski, Poi (2008)
From
Michel Serafinelli <[email protected]>
To
[email protected]
Subject
Re: Re: st: exit variable in opreg by Yasar, Raciborski, Poi (2008)
Date
Fri, 2 Mar 2012 15:32:19 -0800
Dear Nick,
Thanks for your message.
However, I am still puzzled, because tax_code and firmid_op are stored
as double (see output below under -describe-) and still
the exit variable is wrong.
I would really appreciate any suggestions.
I understand that this is a issue not strictly related to -opreg- but
I decided to mention the paper
Yasar, Raciborski, Poi (2008)
“Production function estimation in Stata using the Olley and Pakes method”
The Stata Journal (2008) 8, Number 2, pp. 221–231
because they show how to construct the exit variable, and I was
puzzled by the fact
that using their commands I could not create the right exit variable.
Plus, I think the procedure by
Olley, G. S., and A. Pakes. 1996. The dynamics of productivity in the
telecommunications
equipment industry. Econometrica 64: 1263–1297
implemented by -opreg- is one of the best known examples in which the
exit of a firm is important.
That is why I mentioned opreg. I am sorry if this created confusion.
I copy below the new output from the log file.
Best,
Michel
. xtset tax_code year
panel variable: tax_code (unbalanced)
time variable: year, 1995 to 2001, but with gaps
delta: 1 unit
.
. gen double firmid_op=tax_code
. des
Contains data from dataset_for_opreg.dta
obs: 17,032
vars: 4 1 Mar 2012 20:31
size: 579,088 (99.9% of memory free) (_dta has notes)
------------------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
------------------------------------------------------------------------------------------------------------------------------------
year float %10.0g
matr_az str10 %10s
tax_code double %10.0g
firmid_op double %10.0g
------------------------------------------------------------------------------------------------------------------------------------
Sorted by: tax_code year
Note: dataset has changed since last saved
. duplicates list tax_code year
Duplicates in terms of tax_code year
(0 observations are duplicates)
. duplicates list firmid_op year
Duplicates in terms of firmid_op year
(0 observations are duplicates)
.
. 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)
. br
. list in 1/30
+----------------------------------------------------------------------------------------+
| year matr_az tax_code firmid_op count survivor
has95 has_gaps exit |
|----------------------------------------------------------------------------------------|
1. | 1995 1000009303 1.000e+09 1.000e+09 7 1
1 0 0 |
2. | 1996 1000009303 1.000e+09 1.000e+09 7 1
1 0 0 |
3. | 1997 1000009303 1.000e+09 1.000e+09 7 1
1 0 0 |
4. | 1998 1000009303 1.000e+09 1.000e+09 7 1
1 0 0 |
5. | 1999 1000009303 1.000e+09 1.000e+09 7 1
1 0 0 |
|----------------------------------------------------------------------------------------|
6. | 2000 1000009303 1.000e+09 1.000e+09 7 1
1 0 0 |
7. | 2001 1000009303 1.000e+09 1.000e+09 7 1
1 0 0 |
8. | 1996 1000022830 1.000e+09 1.000e+09 6 0
1 0 0 |
9. | 1997 1000022830 1.000e+09 1.000e+09 6 0
1 0 0 |
10. | 1998 1000022830 1.000e+09 1.000e+09 6 0
1 0 0 |
|----------------------------------------------------------------------------------------|
11. | 1999 1000022830 1.000e+09 1.000e+09 6 0
1 0 0 |
12. | 2000 1000022830 1.000e+09 1.000e+09 6 0
1 0 0 |
13. | 2001 1000022830 1.000e+09 1.000e+09 6 0
1 0 0 |
14. | 1995 1000028092 1.000e+09 1.000e+09 6 0
0 0 0 |
15. | 1996 1000028092 1.000e+09 1.000e+09 6 0
0 0 0 |
|----------------------------------------------------------------------------------------|
16. | 1997 1000028092 1.000e+09 1.000e+09 6 0
0 0 0 |
17. | 1998 1000028092 1.000e+09 1.000e+09 6 0
0 0 1 |
18. | 1999 1000028092 1.000e+09 1.000e+09 6 0
0 0 0 |
19. | 2000 1000028092 1.000e+09 1.000e+09 6 0
0 0 0 |
20. | 1995 1000035962 1.000e+09 1.000e+09 7 1
1 0 0 |
|----------------------------------------------------------------------------------------|
21. | 1996 1000035962 1.000e+09 1.000e+09 7 1
1 0 0 |
22. | 1997 1000035962 1.000e+09 1.000e+09 7 1
1 0 0 |
23. | 1998 1000035962 1.000e+09 1.000e+09 7 1
1 0 0 |
24. | 1999 1000035962 1.000e+09 1.000e+09 7 1
1 0 0 |
25. | 2000 1000035962 1.000e+09 1.000e+09 7 1
1 0 0 |
|----------------------------------------------------------------------------------------|
26. | 2001 1000035962 1.000e+09 1.000e+09 7 1
1 0 0 |
27. | 1996 1000039407 1.000e+09 1.000e+09 3 0
0 0 0 |
28. | 1997 1000039407 1.000e+09 1.000e+09 3 0
0 0 1 |
29. | 1998 1000039407 1.000e+09 1.000e+09 3 0
0 0 0 |
30. | 1996 1000053348 1.000e+09 1.000e+09 5 0
1 1 0 |
+----------------------------------------------------------------------------------------+
-------------------------------------------------------------------------------------------------------------------