Stata - How to use tsset

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • Welcome to my classroom!
    This video is part of my Stata series. A series where I help you learn how to use Stata. In this video, we look at how to declare your data to be time series or panel data.
    Mistake at 5:10
    It should be: tsset compnay time
    Note: What I show here is my take on the topic. I would be happy to receive comments!
    Useful links:
    ►Twitch: / steffens_classroom
    ►Twitter: / steff5001
    ►Workpage: www.rug.nl/sta...
    ►Subscribe: cutt.ly/Qfu9cmV

Комментарии • 24

  • @remcobos6201
    @remcobos6201 3 года назад +5

    Thanks again! I happened to notice that at 5:10 you entered 'tsset time company' but shouldn't 'company' be set as the panel variable such it becomes 'tsset company time'?

    • @SteffensClassroom
      @SteffensClassroom  3 года назад +1

      You are of course right! That is a mistake. Nicely spotted :)
      Fortunately, it the example still works.

  • @mohammedalnour318
    @mohammedalnour318 Год назад

    Very informative dear Dr, many thanks

  • @jingnanli7325
    @jingnanli7325 2 года назад +1

    thank you very much sir. it is absolutely clear!

  • @kaysullivan5434
    @kaysullivan5434 Год назад +1

    Really great video. Thank you

  • @adilreshi2909
    @adilreshi2909 2 года назад +1

    Awesome video professor. Thanks for uploading. I have a query regarding the unbalanced panel with a lot of missing variables...Please inform me which Stata command shall I use when panel data is unbalanced....

    • @SteffensClassroom
      @SteffensClassroom  2 года назад

      Hi Adil!
      Thank you for your comment.
      An alternative to the tsset command is xtset for panel data. Go and try that one out :)

  • @remcobos6201
    @remcobos6201 3 года назад +1

    Does an unbalanced panel influence OLS regression in STATA? (We assume missing observations to be random)

    • @SteffensClassroom
      @SteffensClassroom  3 года назад

      What does it mean that a panel is unbalanced? In short, at least one panel member is not observed each period. When running a OLS, that observations will thus not be there. If these missing observations are random, then it should not give any problems. Further info can be found here: ruclips.net/video/UCPeF01LFwY/видео.html
      I discuss this early on.
      Hope this helps!

  • @jingnanli7325
    @jingnanli7325 2 года назад +1

    thank u sir. your final step tsset bcal_date. in my case, it shows "repeated time values in sample". how to deal with? thank you

    • @SteffensClassroom
      @SteffensClassroom  2 года назад

      Dear Jingnan. Thank you for the question. As Stata signals, I suspect that you may have multiple observations for the same date. In which case you would have to find and remove potential duplicates. You can see my video on how to do that.
      I hope I understood your questions correctly.

  • @ncpamulaklakin1426
    @ncpamulaklakin1426 Год назад +1

    Hello thank you for this vid, but what should I do if my data is weekly? my stata keeps saying " time variable: weekly, 28jan2018 to 26feb2023, but with gaps
    delta: 1 day"

    • @ncpamulaklakin1426
      @ncpamulaklakin1426 Год назад

      Stata date cannot be after Dec 31, 9999 -it says this after the bcal thing

    • @SteffensClassroom
      @SteffensClassroom  Год назад

      In short. If you have weekly data then it is not a business calendar you need, you use option weekly for tsset.

  • @ikhlasmatloob6284
    @ikhlasmatloob6284 3 года назад +1

    When I attempt this STATA tells me that the time value is repeated even when i use the command: tsset Location Quarter. I don't suppose you know a way around this ?

    • @SteffensClassroom
      @SteffensClassroom  3 года назад

      Dear Ikhlas,
      There are a few things you can try and do here. First, do your time and entity identifier uniquely identify your data? Try and use isid Location Quarter. If you get nothing back, well that is good.
      Otherwise, you should check for duplicates, which can be done using duplicates report Location Quarter. This will give you a report to see if you have any duplicates your dataset. If that if the case, you will have to remove any of such duplicates, and then try tsset again.
      Hope this works! Lmk,

    • @ikhlasmatloob6284
      @ikhlasmatloob6284 3 года назад +1

      @@SteffensClassroom I previously used the tsset command and it worked but after filling in gaps in the panel data and duplicating my quarter variable it no longer works. I tried your suggestion and command doesn't work. Do you think using tsset, then filling in missing obvs then using tsfill will work ?

    • @SteffensClassroom
      @SteffensClassroom  3 года назад +1

      tsfill is generally used after tsset, so that is fine. The Stata file will also explain you this: www.stata.com/manuals/tstsfill.pdf
      Hope this helps

    • @ikhlasmatloob6284
      @ikhlasmatloob6284 3 года назад +1

      @@SteffensClassroom thank you for the help Steffen

    • @SteffensClassroom
      @SteffensClassroom  3 года назад

      Happy to help!

  • @cyrilfilezac8115
    @cyrilfilezac8115 2 года назад

    file calendar.stbcal could not be opened for output
    i don't understand why ...

    • @SteffensClassroom
      @SteffensClassroom  2 года назад

      I am.also not certain to be honest. Does this error appear after you use tsset?

    • @cyrilfilezac8115
      @cyrilfilezac8115 2 года назад +1

      @@SteffensClassroom yes but i try to change the directory with : File -> Change directory and it is good. I think it is a file problem

    • @SteffensClassroom
      @SteffensClassroom  2 года назад

      @@cyrilfilezac8115 This would be nice to figure out. Would you mind mail me about the issue (see my mail on the about page on the channel)?