Announcement

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

  • "time variable must contain only integer values" error in stata


    The inflation are up to 2 decimal places tsset inf I get the error message """"time variable must contain only integer values"" On forcing for integer the error message is "repeated time values in sample". ssc install bcuse bcuse phillips, clear

  • #2
    I wouldn't have thought of inflation as a time series variable, but that aside, you could multiply inflation by 100 to get an integer.

    Comment


    • #3
      You need to use the date associated with inflation as your variable for tsset, not the value of inflation itself.
      Jorge Eduardo Pérez Pérez
      www.jorgeperezperez.com

      Comment


      • #4
        Estimado amigo

        mi metodo como siguiente

        ssc install bcuse
        bcuse phillips, clear

        vale, despues....

        sus remedios no funcionan


        . tsset inf, yearly
        time variable must contain only integer values

        . generate inf2=inf*100

        . tsset inf_2, yearly
        time variable must contain only integer values

        Comment


        • #5
          You need to use the date variable when using tsset. This dataset is yearly and dates are in the year variable.

          Code:
          ssc install bcuse
          bcuse phillips, clear
          tsset year
          Espero que esto ayude.
          Jorge Eduardo Pérez Pérez
          www.jorgeperezperez.com

          Comment


          • #6
            Technically, the tsset time variable does not have to be an actual time variable; any integer will do, but it's not clear how one would interpret the results of such an analysis. As Jorge suggests, if you have an actual time variable, you should use it in the tsset command. You can still use inflation as a covariate in any subsequent models.

            Most likely the reason why multiplying inflation by 100 didn't work is because there are more than 2 decimal points of precision. You can fix that by rounding off after multiplying by 100: gen inf2=round(inf*100)

            Comment


            • #7
              estimado jorge
              tsset year
              time variable: year, 1948 to 1996
              delta: 1 unit

              . tsset inf, yearly
              time variable must contain only integer values
              r(451);

              mr Joe
              gen inf2=round(inf*100)

              . tsset inf2
              repeated time values in sample

              I dont understand in eviews there is not problem in the datasets setups and their test....
              stata muy interesante...

              Comment


              • #8
                You only need to one tsset command. tsset year seems to work fine, so now you need to run a regression model. If you are still confused, please tell us what you are trying to do.

                Comment


                • #9
                  I agree with Joe. Once you use tsset year, you don't need to use tsset again. tsset declares your entire dataset (all the variables) to be time series data and you can use time series commands. Maybe what is confusing you is that in Eviews each variable is a separate object.
                  Jorge Eduardo Pérez Pérez
                  www.jorgeperezperez.com

                  Comment


                  • #10
                    """""Once you use tsset year, """ la palabra excelente....Muchas gracias amigos (special thanks to Jorge y Joe)

                    Comment

                    Working...
                    X