Announcement

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

  • I am a newbie in need so apologies

    Sorry to put such an elementary question on here but I have been struggling to get STATA to run my data and running into this problem:

    format %tm date

    . describe

    Contains data
    obs: 96
    vars: 4
    size: 1,056
    -----------------------------------------------------------------------------------------
    storage display value
    variable name type format label variable label
    -----------------------------------------------------------------------------------------
    Date int %tdMon-YY Date
    Indiaarrivals long %10.0g India arrivals
    Dummy byte %10.0g Dummy
    date float %tm
    -----------------------------------------------------------------------------------------
    Sorted by:
    Note: Dataset has changed since last saved.

    . itsa Indiaarrivals, single treat (48) trperiod(2008m12) lag(1) postrend figure
    trperiod() invalid -- invalid numlist
    r(121);

    . tsset date
    time variable: date, 2005m1 to 2012m12
    delta: 1 month

    . itsa Indiaarrivals, single treat (48) trperiod(2008m12) lag(1) postrend figure
    trperiod() invalid -- invalid numlist
    r(121);

    As you can see from above I have monthly data 2005 to 2012 inclusive and trying to run interrupted time series for an event which occurred in December 2008. It keeps giving me the error as shown can anyone help me please?
    Best wishes
    Yeg

  • #2
    Is your name really Yeg Droplet? We ask for real names here.

    The error message is

    Code:
    trperiod() invalid -- invalid numlist
    and that's because trperiod() in itsa (Stata Journal, as you are asked to explain) requires a numeric value. That's what the help for itsa explains (see also its examples).

    You need to enter 587 not 2008m12.

    Code:
    . di ym(2008, 12)
    587
    Please see http://www.statalist.org/forums/help Sections 6, 7 and 12 and 18.

    If you're smart enough to use Stata, and you are, you're smart enough to follow simple requests as laid out there.
    Last edited by Nick Cox; 08 Jun 2016, 12:00.

    Comment


    • #3
      Welcome to Statalist! You are currently providing the date in the displayed format, one which Stata does not understand. Please try providing the actual numerical value corresponding to "2008m12" in your data. Also please have a look at http://www.statalist.org/forums/help for advice on posting.

      Comment


      • #4
        Nick , Thank you very much all sorted :-) and not it is not droplet, will try and change it , if it allows me.

        Comment


        • #5
          You can request a change in user-nam, by clicking the CONTACT US button at the bottom-right of any Forum page. It's missing in latest Mac Chromium, so use another browser..
          Last edited by Steve Samuels; 10 Jun 2016, 15:33.
          Steve Samuels
          Statistical Consulting
          [email protected]

          Stata 14.2

          Comment


          • #6
            Since you acknowledged yourself as a newbie, I wish to add an extra recommendation for your forfhcoming messages. Please try to write in the title something that would really convey the core information.

            The fact of being a newbie, or someone in need, or a remark on apologies for the query, well, such terms have nothing related to the topic, which seems to be a doubt concerning - itsa (SJ) - commands.

            I kindly remind you that, whenever one provides an appropriate title to the queries, he/she paves the way for future Stata users troubled with a similar situation. I believe sharing the solutions with the other members and readers in general is something that makes this Forum an awesome place.

            Best,

            Marcos
            Last edited by Marcos Almeida; 11 Jun 2016, 13:18.
            Best regards,

            Marcos

            Comment


            • #7
              Hi Marcos, sure I will do next time!

              Comment


              • #8
                Hi, I have used this syntax before (stata 14.2) and worked perfectly fine:
                gen t=tm(2008m1)+_n-1
                format t %tm
                tsset t
                di ym(2010,12)
                di ym(2014,09)
                di ym(2015,07)
                itsa Rm, trperiod (611,656, 666) lag(0) posttrend figure

                Using stata 17 it gives me this message:

                m(611,656,666) invalid
                r(198)

                Would you be able to let me know where I am going wrong please?
                Best wishes
                Yeg
                Last edited by Yeganeh Morakabati; 21 Feb 2023, 05:11.

                Comment


                • #9
                  The problem seems to lie in your use of itsa, which is community-contributed and written by Ariel Linden. I would take out the space

                  Code:
                  itsa Rm, trperiod(611,656, 666) lag(0) posttrend figure
                  but otherwise I guess the main issue is that itsa wants semicolons as separators, not commas.

                  Comment


                  • #10
                    Thank you Nick, this has worked:
                    itsa Rm, trperiod (2010,12; 2014,09; 2015,07 ) lag(0) posttrend figure

                    Comment


                    • #11
                      OK, good. Now a request please: For your next question, please start a new thread with an informative title.

                      Comment

                      Working...
                      X