Announcement

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

  • JanDitzen
    replied
    Maybe this function already exists and I am not aware. I would love to save a mata matrix in something like r() or e(). It could be something like m() and would be protected in a similar way as r() and e(). I use more often mata for my Stata programs and I would like to give the user the option to access mata matrices in a similar fashion than r() or e(). My concern so far is that I accidentally overwrite a mata matrix from either another program or the user.

    My work around so far is to call the mata matrix program specific. For example I have a mata program estimating using OLS called mataOLS, then the resulting vector of coefficients would be named mataOLS_b. It would be nicer if it would exits in something like m(b).

    Why do I not transform the matrix into Stata and save it in e() or r()? For large datasets Stata matrices are slow and there are restrictions which do not exist in mata. Also sometimes I pick up mataOLS_b by another (mata) program and do not want to transform matrices back and forth.

    Leave a comment:


  • Stefan Kreisel
    replied
    For the no longer quite so new and shiny topic of "marginal structural models", that allow to accomodate for time-varying confounding, one needs time-varying weights (i.e. inverse probability of treatment weights) per panel, or just simply weights that are allowed to vary per observation, within a panel -> this is not possible the last time I checked - https://www.stata.com/support/faqs/s...ion-and-xtgee/ . The Stata workaround is to do e.g. pooled logistic regression, which is error-prone not least in the way the data must be prepared. Non-stata solutions lead to R: https://cran.r-project.org/web/packa...ltmle-MSM.html.

    Leave a comment:


  • William Lisowski
    replied
    Regarding #325

    In the example code, the problem is not that the erase command does not know where the file TEMP is. The problem is that erase is general purpose - I think of it as a convenience command based on the shell command - and there is no implication that the files to be erased are by default .dta files. In the PDF documentation for erase the first example demonstrates that the .dta suffix is necessary when deleting a Stata dataset. In the code presented,
    Code:
    erase TEMP.dta
    avoids the error.

    With that said, I often - but not always - prefer to use Stata's tempfile mechanism to create temporary files in the (macOS) system temporary directory that are automatically disposed of by Stata when the scope of the temporary variable is exited.

    Leave a comment:


  • Joro Kolev
    replied
    I wish that -[R] bootstrap - has two more options:

    1.) -, replace- where when you bootstrap, the dataset in memory is replaced by the bootstrap resamples (this is the current default behaviour of -simulate-). Currently to obtain this outcome I need to go through lots of pain, First, I need to save the file with the bootstrap replicas somewhere. Second, I need to load the bootstrap replicas, and do the calculations. Third, I hit in the following major inconvenience, when I try to erase the file with the bootstrap replicas:
    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . save TEMP, replace
    file TEMP.dta saved
    
    . use TEMP
    (1978 Automobile Data)
    
    . erase TEMP
    file TEMP not found
    r(601);
    The code above illustrates the following asymmetry: Stata has some working directory which I do not care to know, and which makes my life easier because I do not need to specify full paths for files that I use just for one calculation and then I do not want to save. I can save in this directory my TEMP file, and I can load it from there to do calculations without problems. But then when I try to erase the file because I do not want to be left with million TEMP files on my computer, apparently -erase- does not know where this file is.

    2.) If would be great if -bootstrap- has the option to leave the bootstrap replicas behind in a matrix. Further it would be great if Stata's matrix language can calculate summary statistics such as means, percentiles, min and max etc. of vectors (of rows/columns of a matrix).



    Leave a comment:


  • Sergiy Radyakin
    replied
    I would like to second Clyde's request above, and would like to also request that the type of the aggregate variables may be specified (e.g. to get means as doubles, currently they are calculated as floats only).

    This could be either an option double for all aggregates, or individually prepending variable names with the types. Or even simply changing the default type to double internally.

    Thank you, Sergiy

    Leave a comment:


  • Clyde Schechter
    replied
    I wish -collapse- had two new options.

    -leavevarlabelsasis- would allow the user to specify that variable labels should not be prefixed with (mean), etc. but just left as they were before -collapse-

    -keepvallabels- would cause value-labeled discrete variables to keep their value labels provided that the aggregate summary statistic is consistent with their remaining non-negative integers, such as (first) (firstnm) (last) (lastnm) (min) and (max).

    I have almost come to dread using -collapse- because of all the work you have to do ahead of time to save all the labels and then afterwards to restore them.

    Leave a comment:


  • Sergiy Radyakin
    replied
    At this time the clicks of the mouse cursor on the graph are not utilized for any functionality.

    I'd like to request a magnifier lens for the graphs, similar to the same tool in MikTeX and some other programs (screenshot below).

    This will help those of us with less than perfect vision, less than huge monitors, and be great for presentations and discussions, where one could focus attention more clearly on a particular area.

    Click image for larger version

Name:	graph_zoom.png
Views:	1
Size:	43.5 KB
ID:	1569553



    Also I'd like to explore a possibility to make the graphs zoomable, where a certain area of the graph can be zoomed into (this, by definition, necessitates panning with scrollbars), and possibly with re-rendering of the zoomed area to avoid loosing quality.

    Click image for larger version

Name:	graph_zoom_pan.png
Views:	1
Size:	69.3 KB
ID:	1569554


    Thank you, Sergiy Radyakin

    Leave a comment:


  • Bill Rising (StataCorp)
    replied
    About braces:

    Braces alone do not mean anything. You can create blocks inside of (a)do files just to make it easier to select a bunch of code to send to Stata via Edit > Find > Balance Braces (or command-B aka ctrl-B). Successive command-B's will move outward in the nesting. Here is something to experiment with:
    Code:
    {
      * outer block code
      sysuse auto, clear
      codebook
      { 
        * inner block code
        gen gp100m = 100 / mpg
        regress gp100m weight
      }  
    }

    Leave a comment:


  • William Lisowski
    replied
    Re #319 - the insight into loops offered recently by Bill Rising (StataCorp) ​​​​​at the link below could be usefully incorporated into a more general discussion of braces. I wonder if in fact the attributes he attributes to loops are in fact more generally applicable to braced structures.

    https://www.statalist.org/forums/for...16#post1567116

    Leave a comment:


  • John Mullahy
    replied
    I quite possibly have missed this in the documentation, but if not I would find it helpful to have documented comprehensively a summary of the various uses (and illegal uses) of braces
    Code:
    {...}
    in Stata programs. It would be nice if, e.g.
    Code:
    help braces
    would provide something like this.

    Leave a comment:


  • William Lisowski
    replied
    Re #316 it would be a convenience if Stata formats supported a p suffix similar to the c suffix to support representation as a percentage - both the trailing "%" and the scaling of the quantity by 100. Extra credit if both the p and the c are allowed together, representing 12.3 as "1,230%.

    Leave a comment:


  • Allan Massie
    replied
    Documentation of gr_edit

    Leave a comment:


  • Allan Massie
    replied
    ylabel(0(0.2)1, pct)
    yields ("0%", "20%", "40%"), etc
    Not sure if there's a clever way to do this with ", format()"

    Leave a comment:


  • Allan Massie
    replied
    putdocx save filename, launch

    opens the file in MS-Word after saving.
    And a similar option for
    putexcel
    There are workarounds using ! , but this seems like a simple feature that I think people would like. It saves a small amount of time when running the same code many times to debug a Word/Excel doc.
    Thanks!

    Leave a comment:


  • William Lisowski
    replied
    Re #313: There is no suggestion that every program document the output left behind by every program it calls. But if what's left behind is important enough to users to announce as a feature in help whatsnew, it is important enough to include in the formal documentation that users are advised to read. I came as a new user to Stata 13, was I to read all the past whatsnew output to learn about this feature?

    I further argue that the "Stored results" would be improved by including the non-e-class non-r-class _b and _se, rather than leaving them only to the User's Guide. Reference material should not assume perfect memory of tutorial material - at a minimum it should link to it.

    In [U] 13.6 we see "You can find out what is stored where by looking in the Stored results section for the particular command in the Reference manual." In #312 the suggestion is just that Stata live up to that assertion.
    Last edited by William Lisowski; 10 Aug 2020, 06:10. Reason: Replaced _c with _se - I can only assume my subconscious was calling out for the first cup of coffee of the day to be returned to it.

    Leave a comment:

Working...
X