Announcement

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

  • #16
    Hi sorry to bother you again. I tried running the same code on another computer and I got this error message.
    .
    ***Step 2. Now create a temporary files using
    . tempname anees_uroot

    . tempfile unitroots

    .
    . ***Step 3. Then you need to write to the temporary files as to what should be the
    . *names of the headers of the table. Also you need to specify which file to use and
    . *what to add to the file as headers.
    .
    . postfile `anees_uroot' str12 name dfuller_statistic dfuller_pvalue dfuller_lags perron_statistic pperron_rho pperron_pvalue pperron_lags using `unitroots'
    invalid 'Tin'
    r(198);

    end of do-file

    r(198);

    Is step 3 sensitive to the spacing? or can we break into 2 lines to run.
    Thks

    Comment


    • #17
      I am thinking that the problem is that on the new system, the path to the directory that the tempfile is written in has a space in the name of one of the parent directories. If you run the following commands on that system, you will be able to see the path and see if it has a space in it somewhere.
      Code:
      tempfile unitroots
      display "`unitroots'"
      Note carefully the sequence of quotation marks - a normal double-quote " then the left single-quote ` and after the text, the right single-quote ' and the another normal double quote " .

      So if a space in the path name is the problem you can solve it by using the same double-quotation marks in your command.
      Code:
      postfile `anees_uroot' str12 name dfuller_statistic dfuller_pvalue dfuller_lags perron_statistic pperron_rho pperron_pvalue pperron_lags using "`unitroots'"

      Comment


      • #18
        Hi sorry to bother you again. I tried running the same code on another computer and I got this error message.
        .
        ***Step 2. Now create a temporary files using
        . tempname anees_uroot

        . tempfile unitroots

        .
        . ***Step 3. Then you need to write to the temporary files as to what should be the
        . *names of the headers of the table. Also you need to specify which file to use and
        . *what to add to the file as headers.
        .
        . postfile `anees_uroot' str12 name dfuller_statistic dfuller_pvalue dfuller_lags perron_statistic pperron_rho pperron_pvalue pperron_lags using `unitroots'
        invalid 'Tin'
        r(198);

        end of do-file

        r(198);

        Is step 3 sensitive to the spacing? or can we break into 2 lines to run.
        Thks

        Comment


        • #19
          Post #18 seems to be a copy of post #16 which was addressed in post #17.

          Comment


          • #20
            Sorry to bother you. I tried running the same code on another computer and I got an error message after step 3 as follows:
            postfile `ctf_uroot' str12 name dfuller_statistic dfuller_pvalue dfuller_lags perron_statistic pperron_rho pperron_pvalue pperron_lags usin
            > g `unitroots'
            invalid 'Tin'
            r(198);
            Can step 3 be broken into 2 lines rather one line.
            Tq

            Comment


            • #21
              Sorry about post #20. I didnt see that you have replied.

              Comment


              • #22
                Your suggestion on post #17 works. Tq

                Comment


                • #23
                  I am posting one additional method of collecting statistics, writing them to a matrix and then exporting the matrix to Word with asdoc

                  Code:
                  ssc install asdoc
                  webuse air2
                  
                  * Create a matrix of 2 x3 dimensions
                  mat stats = J(2,3,.)
                  dfuller air
                  
                  * Write the required statistics to the matrix
                  mat stats[1,1] = r(Zt)
                  mat stats[1,2] = r(p)
                  mat stats[1,3] = r(lags)
                  
                  * generate another variable for example purposes
                  gen air2 = air+air[_n-1]/2
                  
                  * Again esitmate the dfuller command for the second variable and write its statistics to the matrix
                  dfuller air2, lag(2)
                  mat stats[2,1] = r(Zt)
                  mat stats[2,2] = r(p)
                  mat stats[2,3] = r(lags)
                  
                  * Send the output to MS Word with asdoc
                  
                  asdoc wmat, mat(stats) replace rnames(Air1 Air2) cnames(Z p-value lags) title(Table 1: Results of dfuller tests)
                  And the results look like
                  Click image for larger version

Name:	asdoc matrix ttest.png
Views:	1
Size:	3.3 KB
ID:	1440207
                  Regards
                  --------------------------------------------------
                  Attaullah Shah, PhD.
                  Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
                  FinTechProfessor.com
                  https://asdocx.com
                  Check out my asdoc program, which sends outputs to MS Word.
                  For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

                  Comment

                  Working...
                  X