Announcement

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

  • Addressing "repeated time values within panel" error with Twitter/observational data

    I have Twitter observational data that I want to convert to panel data for empirical analysis purposes.
    Below is a data example of the main variables, where the id variable refers to each unique user in the dataset

    I ran the following code to declare the data as panel:
    ```
    xtset ID date
    ```
    But I keep receiving the error "repeated time values within panel", but I believe this is not a concern given the nature of how people use Twitter (i.e. some individuals may post several times per while others only post once a month. Therefore, I want to combine observations written in the same day by the same ID/poster, but not sure how to conduct that.

    ```
    dataex ID poster time

    ----------------------- copy starting from the next line -----------------------
    [CODE]
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float ID str36 poster int time

    6 "(crash42 )" 19013
    6 "(crash42)" 19150
    6 "(crash42 )" 19153
    6 "(crash42)" 19166
    6 "(crash42 )" 19166
    7 "(maga82" 18975
    7 "(maga82)" 18977
    7 "(maga82)" 18977
    7 "(maga82)" 19000
    7 "(maga82)" 19000
    8"(costanza)" 19008
    8 "(costanza)" 19008
    ```

  • #2
    Paolo:
    if you do not plan to use time-series related commands, such as lags and leads, you can safely -xtset-your dataset with -panlvar- only.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I am not, so thank you so much!
      It should not be problematic that I received this outcome (i.e. an unbalanced dataset), correct?
      ```
      xtset ID
      ```
      output:
      ```
      Panel variable: id (unbalanced)
      ```

      Comment


      • #4
        Essentially the same question was cross-posted and answered at https://stackoverflow.com/questions/...s-within-panel

        Comment


        • #5
          Originally posted by Paolo Maldini View Post
          I am not, so thank you so much!
          It should not be problematic that I received this outcome (i.e. an unbalanced dataset), correct?
          ```
          xtset ID
          ```
          output:
          ```
          Panel variable: id (unbalanced)
          ```
          Paolo:
          panels are frequently unbalanced, but Stata does not care .
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Originally posted by Carlo Lazzaro View Post

            Paolo:
            panels are frequently unbalanced, but Stata does not care .
            Thanks for the useful support!

            Comment

            Working...
            X