Stata Tutorial: Panel Data Formatting with the "reshape" command

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • Using example data from the World Bank we show how to transform a "wide" format panel to a "long" format panel in Stata using the "reshape" command.
    Link to "Gentle Introduction to Stata"
    www.amazon.com...
    Link to the excellent Introduction to Econometrics Textbook by AH Studenmund:
    www.amazon.com...
    Link to Jeffrey Wooldridge Introductory Econometrics Textbook:
    www.amazon.com...

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

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

    Literal life saver thank you so much!

  • @nazlicansahan4320
    @nazlicansahan4320 4 года назад +3

    How can I do the same exercise with more than one variables? I have the same worldbank data but including GDP per capita and GDP in constant prices. Thanks!

  • @naureenmeghani3217
    @naureenmeghani3217 13 дней назад

    Hi Mike, Thanks for the video. Is there any video available for multilevel mixed effect linear regression model in STATA please :)

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

    If you're trying to go from Long to Wide.. and receive this error... what can I do
    values of variable year not unique within sid stateid
    Your data are currently long. You are performing a reshape wide. You specified i(sid stateid) and j(year). There are
    observations within i(sid stateid) with the same value of j(year). In the long data, variables i() and j() together must
    uniquely identify the observations.

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

    Thanks, very clear!

  • @krabbypatty6896
    @krabbypatty6896 4 года назад +1

    Thank you a lot

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

    this was so useful! thank you!

  • @user-zo1ys8bv7p
    @user-zo1ys8bv7p 3 года назад

    Thank you very much for this tutorial! It helped a lot :)

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

    useful video. thanks.

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

    'command bbopendata is unrecognized'. maybe i should have added something that is not mentioned here, before running the command? how can I proceed?

  • @onwuchekwamalachky7373
    @onwuchekwamalachky7373 4 года назад +1

    Hi, thanks for the tutorial. I have more complex data from UNCTAD GVC data. it has no year but 184 countries with 26 sectors attached to it. how do i reshape such data from wide to long?

    • @mikejonaseconometrics1886
      @mikejonaseconometrics1886  4 года назад

      Good Question! The command is the same, but instead of a time indicator, the j(..) will contain the sector code. So each country will appear in 26 rows, one for each sector. Let me know if that works for you.

  • @123pharmacology
    @123pharmacology 5 месяцев назад

    I want to draw time graphs with panel data. For example I have a patient who had a procedure on Jan12024 and then on Jan 2, his pain score was 2, on Jan 3, his pain score was 6 and jan 10, his pain score was 12 . Let’s assume I have 100 patients, 50 who had the procedure and 50 did not. And so I want to draw time wise graphs for cumulative pain scores on days 1,2,3…….for both patient types in different colors. Is it possible to know this from you. I know I will have to calculate the days on my own which I can do

    • @123pharmacology
      @123pharmacology 5 месяцев назад

      By the way…excellent stuff. I subscribed you

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

    Hey thanks a lot for the video, what do we do if the name of the year is not yr + year but just D, E, F and so on?

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

    What if we dont have year variable? It's in the same year

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

      For it to be panel / longitudinal data, there will be a “time” or “date” variable to play this role. If all observations are from the same time period, it will be cross-sectional data, and the reshape command will not be necessary.