Announcement

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

  • Panel Setting problem, and country-year fixed effects

    Hi to everyone,


    Im new in Stata programing, and it would be very helpful if someone gave me an opinion about my two problems .

    First: I am trying to create a panel setting. woriking with sales data across several countries. Im trying to find the effect on saleid which is the effect of one particular law on the specific products (which are quoted by id) on specific time periods (example december 2013 or july 2012). as you can see in the first attachment.

    i have already created a group indicator using the commands: egen id1=group(id) and egen date2=group(date) (attachment 2) but when ive try to create the pannel setting using the comand xtset id1 date2 i always get the following comand : repeated time values within panel r(451); also when run only xtset id1 i tells me that the pannel is unbalanced. the only command that i managed to find in internet was to drop if date==date[_n-1] however im not fully covinced that this is a proper way to deal with my data.
    my question is can I just go on with xtreg command even in the case of unbalanced pannel, will my estimators be biased ?


    Second: in my regression I also trying to enter two fixed effects. the product-date fixed effect and the country-year fixed effect, so that to account for trends in the product and countries. i was just wondering if just an intenaction term between the variables of country and year would do the trick?


    Any idea or advice would be highly appreciated.
    Attached Files

  • #2
    Rebani:
    1) provided that you don't plan to use time-series commands, such as lags and leads, yiu can safely -xtset- your dataset with -panelid- only.
    2) panel unbalancedness is not an issue, as Stata can handle both balanced and unbalanced panel datasets.

    As far as your other questions are concerned, please act on the FAQs that recommend to post what you typed and what Stata gave you back, along with an excerprt/example of your dataset (via -dataex-, please) and avoid posting screenshots, as they cannot be elaborated on.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Dear Carlo,

      Thanks a lot for your adivices, they were very helpful. i appriciate a lot.

      Also for the country-year and product-year fixed effect, would it be enough to code them with just an interaction term?

      Comment


      • #4
        Rebani:
        yes, you can try that approach and see what Stata returns.
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment

        Working...
        X