Announcement

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

  • JanDitzen
    replied
    Originally posted by Vivek Gupta View Post
    Two Wishlist items
    1. Ability to switch working directory to the directory where the do file is located. It would help in situation where the entire folder with the DO and DATA files is shared with someone else. No need to cd into different directories in different computers. In other word, the DO wil executes based on path relative to the location of the do file
    This would be great and helpful, even for programmers. In particular to know where a certain do file is located. I think it was already mentioned and discussed.

    An easy workaround with limitations for this (if the paths are know) is to create a local for each user and use capture when loading data. I combine this with the local c(username) when I have different usernames for different PCs I am working on, but the folder structure is the same. For example, say two researchers work on the same do file which uses contents from a specified ado file and one of the researchers works on different machines with the same folder structure (like a shared folder like dropbox etc.). Then this works well:
    Code:
    local path1 "C:\Users\\`c(username)'\Dropbox\My Resarch Folder\"
    local path2 "C:\Research2\Random Research Folder\Subfolder Shared\"
    
    cap adopath + "`path1'\ado"
    cap adopath + "`path2'\ado"
    
    cap cd "`path1'"
    cap cd "`path2'"
    This works fairly well, of course only within its limitations.

    Originally posted by Vivek Gupta View Post
    Two Wishlist items
    2. Ability to embed graphs in the SMCL file. This way the SMCL file upon opening can directly show the graph and makes it so much easier for someone who is just reading the results.
    I really like this idea. In particular if it would be extended to sthlp files as well. Also, it might be nice to have the Greek alphabet or symbols and sub and superscripts in sthlp. This would make any mathematical equations much easier to read and understand.

    Leave a comment:


  • Vivek Gupta
    replied
    Two Wishlist items
    1. Ability to switch working directory to the directory where the do file is located. It would help in situation where the entire folder with the DO and DATA files is shared with someone else. No need to cd into different directories in different computers. In other word, the DO wil executes based on path relative to the location of the do file
    2. Ability to embed graphs in the SMCL file. This way the SMCL file upon opening can directly show the graph and makes it so much easier for someone who is just reading the results.

    Thanks
    Vivek

    Leave a comment:


  • Nicholas Winter
    replied
    Small tweak to -marginsplot- : an easy-to-use option for relabelling the legend keys based on the logical plot number, rather than the actual plot number of the underlying call to -graph-. Marginsplot plots first the confidence intervals, then the point estimates, which means that the legend key for the n'th plot is actually k+n, where k is the total number of plots. (see, e.g., post #6 on this thread: https://www.statalist.org/forums/for...mbomarginsplot ).

    Leave a comment:


  • Friedrich Hula
    replied
    I would like to see a function that creates treemaps like in Excel, but in Stata beauty.

    Leave a comment:


  • Clyde Schechter
    replied
    Re #68: merging frames is accomplished easily using the -frlink- command and then the -frget- command or -frval()- function. If you need to save the results of a merge you can then do that. As for appending frames, that has been discussed earlier in this thread and there is already a user-written command to do that, but I agree it would be nice for Stata to include it as part of the installation.

    Leave a comment:


  • Jen Walker
    replied
    Merging and appending frames
    Last edited by Jen Walker; 27 Nov 2019, 21:55.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    I just discovered that there is no possibility to tell the regress postestimation command estat ovtest for Ramsey's RESET test the order of the powers of the fitted values I want to use. The command uses by default powers 2 to 4 of the fitted values and there is no option to change that. It should be easy to add an option that allows specifying that I only want powers, say, up to order 3.

    Leave a comment:


  • Alex Weckenman
    replied
    I would love to have more functionality in putdocx, especially around posting summary statistics and other types of tables. Similarly, it would great to augment putexcel so it can post tables and other outputs as they appear within Stata without having to recreate them via matrix operations and alignment (e.g., for tab results, having to do matrix operations to get column/row percentages, having to loop through a matrix to post the variable levels).

    Leave a comment:


  • Niels Henrik Bruun
    replied
    1. I often need to look into the code in ado and mata files. I would like the -Mata/Stata which- command to have an option open sending the ado file to the do-file editor. In the case of mlibs I think we to develop concepts like unit-testing and/or help files describing the content. Too much (including my own code) is too little documented. I am thinking in developing a concept like docutils from Python.
    2. We need more than one "end", a mata-end and now also a Python-end. Having the same keyword ending different sets of code is bad.
    3. In Mata I would suggest that optional parameters in function calls can be called by name and not just by position. And that default values for optional parameters can be set in the function header. Again, inspiration is from Python
    4. I think for really being able to develop scientific concepts into Mata a sort of operator overload for classes is needed. In Stata, we know that the difference between two dates is the number of dates and adding an integer to a date gives another date. In a sense it is nonsense adding numbers and dates, but it is intuitively easy to understand. This kind of math exist in more places. Eg in finance an yieldcurve which offers prices at all times could be multiplied to a cashflow (a set of future payments at certain dates). Basically, this is the simple price times amount formula hidding the date matching behind. In statistics, all sorts of regression outputs are stochastic variables. Often we eg subtract these variables to get the effect. Could it make sense to define subtraction of two fractional polynomials? I know that for some of this we have lincom etc, but that is for Stata. And I don't think that it is flexible enough for what is comming
    5. The final Pythonic suggestion is that in Python you have __main__, so if Python code in a file is called as a main program one can set up a set of commands to be done. Often the structure in larger analyses is to have a master do-file running a set of minor do-files. These minor files needs testing, which could be run in a slightly different environment (using eg only a subset of data).
    That said, I think Stata and Mata are fantastic tools to work with
    So thank you to Stata Corp and all contributors in the Stata environment

    Leave a comment:


  • Jean-Claude Arbaut
    replied
    Alexandre Cazenave-Lacroutz

    Regarding your doubts about your rights to distribute your modified code, the Stata license states that:

    2.5 License to StataCorp Enhancements.
    Subject to the terms and conditions of this Agreement, StataCorp grants to Customer a non-assignable, nontransferable, royaltee-free license, without the right to sublicense, to use the StataCorp Enhancements solely with the Software for Customer's internal business, research, or educational purposes. In addition, subject to the terms and conditions of this Agreement, StataCorp grants to Customer a non-assignable, nontransferable, royaltee-free license to modify, reproduce, and distribute the StataCorp Enhancements to create Customer Enhancements solely for use with the Software. Customer may distribute the Customer Enhancements to third parties either at no charge of for a fee.
    StataCorp Enhancements means, among others, ado files distributed with Stata.

    So it seems you can distribute your modified xtregar. A good question, however, would be: under what type of license? I leave this to StataCorp to clarify. Enrique Pinzon (StataCorp)


    It's an occasion to mention another problem regarding license and Stata programs. A common way to distribute Stata software is via SSC, and you may contact Kit Baum at Boston College to publish code there. However, I don't remember seeing any licensing terms in packages at SSC, which is not very satisfying. Compare to the (good) practice of always specifying the license on CRAN...

    A related post, without an explicit answer either: st: RE: license type of user-written ado files on SSC. However, contrary to what this post seems to suggest, a program with no license information is absolutely not in the public domain - or even open source. See Open source code with no license… can I fork it? So, while StataCorp encourages reusing code, most SSC packages can't in fact be legally reused.

    Leave a comment:


  • Alexandre Cazenave-Lacroutz
    replied
    Thank you Enrique for highlighting it, as my message was imprecise. There is indeed nothing incorrect in the sense that the xtregar,FE command does indeed what the Stata documentation explains, and which might be the current common practice (namely, applying the Baltagi-and-Wu transformation before differentiating). However, save a mistake from us, although the Baltagi-and-Wu transformation is well-adapted to the random-effects AR(1) model (ie. xtregar,RE), we show that it is not well adapted to the fixed-effects AR(1) model (xtregar, FE). This may cause a bias in the various estimated quantities. Happily, we are able to propose consistent estimators for all parameters.

    In case our consistent estimators cannot be implemented by StataCorp as long as our working paper above is not published somewhere, I will make available soon on my Github page the ado-file that I now use instead of xtregar.

    PS: To all interested in those issues, note that in another working paper, we show that there is a similar phenomenon with the estimation of the autocorrelation coefficient, particularly in the unbalanced case. And we already proposed an implementation of our new estimation method for the autocorrelation coefficient. See ssc install rho_xtregar. (or go to my Github page for the lattest version)
    https://github.com/ACL90/rho_xtregar...sturbances.pdf
    (As there is still work on this working paper, I did not even dare to suggest it for Stata17.)

    PS2: @Enrique: On the wish list, I still think that the documentation of xtregar could be improved regarding what e(sigma_e) means.

    Leave a comment:


  • Enrique Pinzon (StataCorp)
    replied
    To all interested, we would like to clarify that there is nothing incorrect in our implementation of xtregar, fe. In his paper, Alexandre proposes a new method which differs from the one in the documentation for our command.

    Leave a comment:


  • Alexandre Cazenave-Lacroutz
    replied
    Save mistakes from us, we recently showed that there are estimation mistakes in xtregar, FE and we suggested solutions: Please see
    https://github.com/ACL90/rho_xtregar...ons_v1_0_0.pdf
    I am aware that these are not big changes but:
    1- Maybe our corrections could be taken into account?*
    2- The documentation of xtregar could also be made clearer. (if you are not convinced of that, ask to a few people (that does not know the sourcecode of the command and that are outside StataCorp) what e(sigma_e) is.)

    *As we modified xtregar code (that is a Stata official command), I do not know if we can freely share the code of our modifications online. But we can send it if asked.

    Leave a comment:


  • Santosh Dash
    replied

    I would appreciate it if the following features are added in Stata 17.
    1. Panel unit root tests with a structural break
    2. Time series unit root tests with two structural breaks such as Narayana and Popp (2010), Lee and Strazicich (2013, 2003)
    3. Dynamic panel threshold models such as Bick (2010), Kremer et al. (2009)

    Thank you.

    Leave a comment:


  • Bryant Be
    replied
    Sure. I can definitely clarify. The only source I can easily google which explains how the basic (?) regex functions work (e.g., regexm and friends) in Stata is this one:

    https://www.stata.com/support/faqs/d...r-expressions/

    The set of functions listed at this web page:

    http://userguide.icu-project.org/strings/regexp

    is much larger.

    Just for comparison, if I do:

    Code:
        gen test1 = regexm(note_text, "\.(?!\d)")
        gen test2 = ustrregexm(note_text,"\.(?!\d)")
    The regex in the first command maybe isn't even valid? I get the message:
    Code:
     regexp: ?+* follows nothing
    a few thousand times on my data, and the variable
    Code:
     test1
    is zero for all rows.

    The second command w/ the same regex executes without any problem (or: without the maybe-error-message from the prior command) and
    Code:
     test2
    is 1 about 60% of the time (on the same data).

    At the very least then it seems to me that the two commands generate different outputs for the same regex. I don't know if the negative lookahead (?!...) construction is valid with
    Code:
     regexm
    or if something else is wrong. This is surely worth explaining. (FWIW: the text I'm using is pure plain text w/ no fancy characters outside the ASCII set AFAIK.)
    Last edited by Bryant Be; 09 Nov 2019, 13:05.

    Leave a comment:

Working...
X