Hey everyone. I have real econ question this time! Okay, so I wanna reproduce figure 4, panel B of this paper (see page 21 if interested) It involves transforming monthly percentage growth rates to their real values (in this case, the product we're concerned with is luxury watch imports). The dataset exists in R (don't worry, I've tidied up the basics), and I present the relevant variable below.
Here's where the problems begin. In R, the way the authors transform the growth rate to the total import value is
which is just fancy schmancy R code for
Well, when we do this though, something interesting happens. R and Stata both produce identical values, however, in the paper, the lower bound of the Y axis is 20 (20 million dollars). the lower bound in both R and Stata is 0.736! This suggests one of two things: either the authors made an error in their calculations, or, there's some specific way of converting from growth rates to levels that they didn't put in their code. Is there another way that one might use to convert monthly growth rates to the levels value, because 0.736 is quite far from 20.
P.S.: Yes, I've emailed Zhentao about this, I was just curious if anyone else might have a better explanation.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long(id month) float(product treated) 1 601 -.3059372 0 1 602 .5280703 0 1 603 -.2787752 0 1 604 .04519186 0 1 605 -.02752761 0 1 606 .14188136 0 1 607 -.09538406 0 1 608 .22210488 0 1 609 .1210361 0 1 610 .1762661 0 1 611 -.04707132 0 1 612 -.206153 0 1 613 .09640702 0 1 614 .25957444 0 1 615 -.019006895 0 1 616 .05884018 0 1 617 .05663636 0 1 618 .16076256 0 1 619 -.3387509 0 1 620 .1599616 0 1 621 .2590707 0 1 622 -.1175653 0 1 623 .0823155 0 1 624 -.57728165 0 1 625 .2887118 0 1 626 .19027576 0 1 627 -.04159575 0 1 628 .07965107 0 1 629 -.157954 0 1 630 -.0904241 0 1 631 -.0689114 0 1 632 .14127608 0 1 633 .07703104 0 1 634 -.00528429 0 1 635 -.13722466 0 1 636 -.4204597 1 1 637 -.1742234 1 1 638 .16987443 1 1 639 -.0021465882 1 1 640 .179711 1 1 641 -.0536652 1 1 642 -.01583692 1 1 643 -.15609664 1 1 644 -.13580869 1 1 645 .2965978 1 1 646 -.06018283 1 1 647 .24309935 1 1 648 -.5410025 1 1 649 .2207956 1 1 650 -.1882118 1 1 651 .08216941 1 1 652 .06764874 1 1 653 -.18822004 1 1 654 .5548315 1 1 655 -.4751124 1 1 656 .034530647 1 1 657 .12505059 1 1 658 -.14233308 1 1 659 .1529133 1 1 660 -.1231552 1 1 661 -.12265544 1 1 662 .21872626 1 1 663 .27011153 1 1 664 -.261104 1 1 665 -.08026836 1 1 666 .0892446 1 1 667 -.29590556 1 1 668 -.03112456 1 1 669 .4658253 1 1 670 .05001443 1 1 671 -.3329245 1 end format %tm month label values id id label def id 1 "Product1", modify xtset id month, m
Code:
exp(cumsum(c(result$in_sample$observation, result$out_of_sample$observation)))
Code:
qbys id: replace product = exp(sum(product))
P.S.: Yes, I've emailed Zhentao about this, I was just curious if anyone else might have a better explanation.
Comment