Announcement

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

  • With reference to Rene Macon's post (#95) on dfuller, dfgls, and pperron, in the most recent Stata 16 update, these commands store critical values and/or a few other additional results in r(). update all for the latest.

    -- Kreshna

    Comment


    • I would like to thank StataCorp for adding JPG export support to all platforms in the most recent 16.1 update.

      Comment


      • Originally posted by Jen Walker View Post
        I think it would be great to have the ability to embed graphs in output - such as log files and the results window.
        I welcome any suggestions if people have made this work.
        One obvious solution here would be a Stata kernal for Jupyter, and, well, it looks like someone has already done this (I haven't tried it and can't vouch for it though):
        https://github.com/kylebarron/stata_kernel

        For those who don't know, Jupyter is, more or less, an IDE originally for Python that has been extended for use by pretty much any language that wants to use it. Inline graphs are just one thing you can do. That's not a great description, but just google it if interested.

        FWIW, I find Stata's IDE or user interface to be generally tolerable, but also pretty inferior to stuff like Jupyter or R Studio. I would love if Stata 17 had an option to use a Jupyter or RStudio interface (whether the option is at install or is a dynamic toggle). I think it would be a pretty trivial task for StataCorp to implement although I don't know what sort of proprietary interests might interfere or whether Jupyter has an overly restrictive GNU license or something.

        (In a pinch I might be happy enough to overlook this if I could just tab complete and use arrows instead of PgUp/PgDn ;-)

        Comment


        • Originally posted by John Eiler View Post
          One obvious solution here would be a Stata kernal for Jupyter, and, well, it looks like someone has already done this (I haven't tried it and can't vouch for it though):
          https://github.com/kylebarron/stata_kernel
          I've used the Jupyter kernel for Stata mentioned at this link, and I can confirm it actually works very well. It puts graphs directly in output, supports tab completion, and supports all types of Stata comment syntax. (However, installation can be a bit tricky, involving manual edits to a config file). If StataCorp were to offer an official kernel, I think it would be a very nice feature.

          FYI, since I only found this out recently myself--Stata's command line does actually have tab completion, but only for variable names.

          Comment


          • Originally posted by Kye Lippold View Post
            However, installation can be a bit tricky, involving manual edits to a config file). If StataCorp were to offer an official kernel, I think it would be a very nice feature.
            Thanks! It's great to hear that, although "manual edits to a config file" is exactly why it would be great to have it built in, especially as one might not have necessary admin privileges to do this on a work computer, for example.

            Comment


            • A panel data three-stage least-squares regression with a full set of post estimations tools to identify overidentification, overall diagnostics, and a set of robust standard errors (like White-Arellano, Driscoll-Kraay, etc.) to account for cross-sectional dependence, autocorrelation, heteroskedasticity.

              An official autocorrelation test for panel data regressions would be also useful since Woolridge command with xtserial sometimes doesn't allow time operators.
              Last edited by John Riveros; 02 May 2020, 07:04.

              Comment


              • int wordpos(s1,s2) function, returns the position of word s2 in line s1. For example
                Code:
                wordpos("AAA CCCCC BBB CCC DDD CCC BBB AAA", "CCC") => 4
                (result is 0 if s2 does not enter s1 as a separate word).

                This can be implemented with tokens() and a loop, or tokenize, or some other techniques,
                but is a common task and I feel deserves a built-in solution. (if there is one, please point me).

                Comment


                • Sergiy Radyakin at post #202:

                  It would be nice to have wordpos() as a general function usable on variables in a dataset. Because you seem to be thinking of macros, though, the following demonstrates a solution in that context.
                  Code:
                  . local words AAA CCCCC BBB CCC DDD CCC BBB AAA
                  
                  . local pos : list posof "CCC" in words
                  
                  . display "CCC found in position `pos'"
                  CCC found in position 4

                  Comment


                  • Re #202

                    Code:
                    local a "CCC"
                    local b "AAA CCCCC BBB CCC DDD CCC BBB AAA"
                    
                    display `: list posof "`a'" in b'
                    I have a Mata implementation of something similar as aposb() in my elabel package (SSC) but I guess Sergiy is clever and skilled enough to code this better himself.

                    Ben Jann has mm_posof() in moremata (SSC).
                    Last edited by daniel klein; 05 May 2020, 18:57.

                    Comment


                    • Thank you William and Daniel!

                      Indeed workarounds exist. In Mata one could do:

                      Code:
                      H="AAA CCCCC BBB CCC DDD CCC BBB AAA"
                      N="CCC"
                      selectindex((tokens(H))':==N)[1]
                      In Stata, as William correctly explains, the macros are not applicable to the variables, as they will be evaluated for the first observation, then the result can be propagated throughout, but not reevaluated for every observation separately. There are two true functions to work with words in Stata (below) and wordpos() could become a reasonable extension at a very small cost, leaving all obstacles like having to know the difference between functions and extended macro functions out of the way of a novice user.

                      Alternatively, a greater scale feature could be introduce finally in version 17 the possibility to write own functions that could be utilized seamlessly in the Stata's ado code in the expressions like generate x=myfunc(var1,var2,..,vark)

                      Stay safe! Thank you!

                      Click image for larger version

Name:	word_functions.png
Views:	1
Size:	51.8 KB
ID:	1551465

                      Comment


                      • Generalize matrix assignment so that row and column names can be on the left hand side as well as on the right hand side. Currently
                        Code:
                        matrix b2 = b1["name","name"]
                        is supported but

                        Code:
                        matrix a["name","name"] = 0
                        is a "Type Mismatch". See U14.9(6) and U14.9(7)

                        Code:
                        matrix a[1,1]=0
                        is already allowed..

                        Comment


                        • I generally agree with #206, but note also that (the extraordinarily inelegant)
                          Code:
                          matrix a[rownumb(a,"name"),colnumb(a,"name")] = 0
                          is a workaround. But it does seem as if Stata should be able to save the user some typing.

                          Comment


                          • I would love the existing boolean and/or operators &/| to be made syntactically equivalent to the operators &&/|| . That is I am suggesting making the 2 forms equivalent, which is not the case with other languages where the single ampersand or pipe would be indicate either bitwise or forced eager evaluation (depending on the language), but neither of these cases is relevant to the Stata paradigm as far as I am aware. Thus I don't think there would be unwanted side effects.

                            Why?
                            Whenever I have just been writing code in any of the myriad of languages based on C syntax and come back to Stata, I get this wrong every second command! Obviously for 1 user this is irrelevant, but does anyone else experience this problem?

                            Comment


                            • A minor shortcut - up and down arrows scrolling through previous commands entered in the command panel, without the needing to use the mouse to select a command from the history panel. This is very common behavior for many (?most) modern console interfaces.

                              Comment


                              • Brent McSharry You can use page up and page down to do that, at least in Windows. I imagine it will be similar on a Mac.

                                Comment

                                Working...
                                X