Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quarterly panel data

    Hello,
    I'm a new beginner with Stata.
    I am conducting a master's thesis to evaluate the Sino-U.S. China friction on the bilateral trade (5,874 HS 8-digits) between China and 59 other countries (divided into 3 groups: 1 ASIAN, 2 Developed countries, and 3 Developing countries).
    I have quarterly panel data from 2013q1 to 2022q4 with a total of 14,097600 observations from 60 countries including the USA with 5,874 products (HS 8 digits ) of each country.
    I would like to compare the trade flow of China's change before and after 2018q3 (when the friction occurred) and the differences in each group to see which one China will trade with more.
    I read about DID (China trade with the USA as a treated group) and I began to generate new var time but it doesn't work.

    [CODE]
    gen time=0
    replace time=1 if quarter>=2018q1
    2018q1 invalid name

    And before that, the quarter var code is below
    [CODE]
    reshape long cn_imp cn_exp partner_GDP cn_GDP distance friction CPI exchange_rate population covid_case FTA contig lang_ethic cn_CPI cn_covid_case cn_population partner_tariff_cn cn_tariff_partner,i(ID)j(SQDate) string
    gen quarter = quarterly(SQDate,"YQ") , after(SQDate)
    format quarter %tq
    drop SQDate

    I am so confused about what happened with my code.
    One more problem I face is when I logarithm ( import's values /export's values) there are a lot of missing values because of the zero values.
    So which is the best estimator for my thesis?

    Anything you could recommend me would be so useful to me.

    Attached Files
Working...
X