Announcement

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

  • wbuchanan
    replied
    Adopt the POSIX epoch for date/datetime variables. This could potentially affect older files, but should make it easier to use the existing APIs for other languages which tend to use dates/datetimes based on a different epoch date. (This could potentially also have an effect on the datetime format that includes corrections for leap seconds).

    Leave a comment:


  • Bjarte Aagnes
    replied
    ref #296
    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . qui reg  price mpg headroom
    
    . 
    . matlist e(b)*invsym(e(V))*e(b)'
    
                 |        y1 
    -------------+-----------
              y1 |  427.7852 
    
    . 
    . bootstrap w=(e(b)*invsym(e(V))*e(b)') : reg price mpg headroom
    (running regress on estimation sample)
    unknown function invsym()
    error in expression: e(b)*invsym(e(V))*e(b)'
    r(133);

    Leave a comment:


  • Joro Kolev
    replied
    This is fascinating, Bjarte. If Stata Corp have fixed this, it would be beautiful !

    Can you try please this a bit more meaty and realistic example, this is actually what I need this one line feature for:

    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . qui reg  price mpg headroom
    
    . matlist e(b)*invsym(e(V))*e(b)'
    
                 |        y1 
    -------------+-----------
              y1 |  427.7852 
    
    .  bootstrap w=(e(b)*invsym(e(V))*e(b)') : reg price mpg headroom
    (running regress on estimation sample)
    matrix operators that return matrices not allowed in this context
    error in expression: e(b)*invsym(e(V))*e(b)'
    r(509);
    
    . version
    version 15.1


    Originally posted by Bjarte Aagnes View Post
    Ref #294
    Code:
    * Stata/MP 16.1 for Windows (64-bit x86-64) Revision 30 Jun 2020
    
    . sysuse auto, clear
    
    . qui reg price mpg headroom
    
    . local rowsplusone = rowsof(e(V))+1
    
    . mac dir _rowsplusone
    _rowsplusone: 4

    Leave a comment:


  • Bjarte Aagnes
    replied
    Ref #294
    Code:
    * Stata/MP 16.1 for Windows (64-bit x86-64) Revision 30 Jun 2020
    
    . sysuse auto, clear
    
    . qui reg price mpg headroom
    
    . local rowsplusone = rowsof(e(V))+1
    
    . mac dir _rowsplusone
    _rowsplusone:   4

    Leave a comment:


  • Joro Kolev
    replied
    Stata returns error message when you try to equate a local or a scalar to a matrix expression which evaluates to a scalar. The fix to this "feature" of Stata is to split the operation on two lines, like I am showing below. There are two problems with that. 1) This "feature" of Stata does not seem to be clearly explained anywhere, and it is always a trial and error figuring out which matrix expression Stata will consider evaluation, and which picking up an element. 2) I want to be able to do this in one line, leading example being when I am bootstrapping a statistic which is a matrix expression evaluating to a scalar. If I could do this on one line, I could directly use the canned bootstrap. Currently I need to write a whole program to be able to implement the two line solution.

    Example:

    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . qui reg price mpg headroom
    
    . local rowsplusone = rowsof(e(V))+1
    matrix operators that return matrices not allowed in this context
    r(509);
    
    . mat tempmat =  rowsof(e(V))+1
    
    . local rowsplusone = tempmat[1,1]
    
    . mat list tempmat
    
    symmetric tempmat[1,1]
        c1
    r1   4
    
    . dis `rowsplusone'
    4

    Leave a comment:


  • Clyde Schechter
    replied
    @291, 292: And more generally, if you wrap a group of commands inside a program, then -runby-, written by Robert Picard and me, and available from SSC, can executed by groups. -runby- is also much faster than looping over -levelsof- variables, which is the conventional workaround for lack of by-ability.

    Leave a comment:


  • FernandoRios
    replied
    Hi Joro,
    that is true, -by- doesnt allow for multiple operations like that, directly, but you can implement or use -egen- functions.
    for example
    Code:
    by group:egen newvar=mean(x)
    does exactly what you describe.
    Granted, for more complicated problems it requires bit of programming.
    Fernando

    Leave a comment:


  • Joro Kolev
    replied
    Not that I have any hope that this will be done, but one of the three major way in which Stata torments me is that the -by- construct does not allow multiple operations.

    I would love to have something like this (imaginary code follows, this does not work):

    Code:
    by group: summ x \ gen newvar = r(mean)

    Leave a comment:


  • Niels Henrik Bruun
    replied
    Looking into the Stata documentation today I was quite surprised to discover that there is no way of inserting a Mata string matrix into a word document.
    So I suggest that _docx_add_mata can take a string matrix as well as a real matrix as argument.

    Likewise for pdf and fillMataMatrix.

    The reason is that it might be needed to handle formatting etc in Mata and then export the formatted result.
    And there is no reason I can see for limitating matrices to be only real.
    Last edited by Niels Henrik Bruun; 29 Jul 2020, 01:15.

    Leave a comment:


  • Leonardo Guizzetti
    replied
    Originally posted by Adrien Bouguen View Post
    Including gsort option into bysort i. e. that I can write bys X Y (-Z): gen newvar=mean().
    Indeed, it would be nice to generalize sort so that -gsort- will set the indicator that the data have been sorted.

    Leave a comment:


  • Adrien Bouguen
    replied
    Including gsort option into bysort i. e. that I can write bys X Y (-Z): gen newvar=mean().

    Leave a comment:


  • jerome falken
    replied
    There is no reason to link it to libpng12 and libpng16 really; please migrate the code relying on libpng12 (likely the icons from the menubar, etc.) to the latest libpng libraries. Modern linux distributions no longer include libpng12.

    Code:
    $ ldd xstata
    linux-vdso.so.1 (0x00007ffff23c8000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9f50b0f000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9f508f1000)
    libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f9f504aa000)
    libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f9f503f3000)
    libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f9f503ca000)
    libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f9f5020c000)
    libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f9f501f1000)
    libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f9f501e1000)
    libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f9f501bb000)
    libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f9f5009b000)
    libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f9f50050000)
    libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f9f4ff94000)
    libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f9f4ff4c000)
    libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f9f4fef7000)
    libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f9f4fef1000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f9f4feec000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9f4fee2000)
    libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f9f4fdc3000)
    libpng12.so.0 => /home/XXX/lib/libpng12.so.0 (0x00007f9f4fb9a000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9f4fb80000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9f4fb5f000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9f4f99e000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9f4f81b000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9f4f816000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f9f50cc6000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f9f4f6d3000)
    libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f9f4f4d0000)
    libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f9f4f4cb000)
    libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f9f4f2c5000)
    libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f9f4f0bb000)
    libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f9f4f0b6000)
    libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f9f4eea4000)
    libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f9f4ec99000)
    libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f9f4ec8c000)
    libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f9f4ea7a000)
    libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f9f4ea1b000)
    libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f9f4e7f3000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f9f4e7d7000)
    libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f9f4e6dc000)
    libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f9f4e636000)
    libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f9f4e5fd000)
    libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f9f4e5f8000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f9f4e5cc000)
    libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f9f4e5bd000)
    libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f9f4e5b2000)
    libfribidi.so.0 => /usr/lib/x86_64-linux-gnu/libfribidi.so.0 (0x00007f9f4e595000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f9f4e558000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f9f4e54d000)
    libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f9f4e543000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9f4e4cf000)
    libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f9f4e47a000)
    libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f9f4e44d000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f9f4e247000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f9f4e041000)
    libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f9f4e037000)
    libbsd.so.0 => /usr/lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f9f4e01d000)

    Leave a comment:


  • Marcos Almeida
    replied
    Friedman's ANOVA. Why not?

    Yes, I know this is a basic test. Yes, I know we have some community-contributed programs that can delve with it (some with challenging strategies for the novice, such as transposition; some needing a good understand of what is being done, since the output doesn't underline 'Friedman', because it was originally created to fulfill a different task).

    In short, the very fact that Friedman's ANOVA is available in several quite 'basic' statistical software prompts us, Stata lovers and users, to spot this missing issue.

    Leave a comment:


  • Nick Cox
    replied
    Bruce Weaver #283 I have two main bar chart commands that I regard as current -- catplot and tabplot -- and ten predecessors that almost share the oblivion of most history -- and some further commands that can produce bar charts under recast(). So, your coming up with yet another design can't be a surprise.

    Having to generate new variables first before you can draw a bar chart makes sense to you as an experienced user, but the issue is what newish users can appreciate. Good to see
    separate coming in useful.

    Leave a comment:


  • Nae Khar
    replied
    Please note that there is a big difference between user friendly and downright awful.

    There are ways to be user friendly while maintaining the programs strength, soul and identity — so that one can still be a self-respecting nerd and use it.

    Look at how Josh Angerst has brought applied econometrics to the masses through fun, informative, and high quality youtube lectures (https://www.youtube.com/playlist?lis...6hDib27OCvcyW8). Stata can bring data analysis to the masses through a more user friendly and discoverable interface.

    Especially when today, predictive modeling and the use of data analysis has expanded greatly to a wide variety of majors and jobs.

    There is a huge business opportunity here, but an even bigger service opportunity to bring powerful predictive modeling to a wider audience, who are not your traditional code savy base.



    @Bruce Weaver
    I work with longitudinal datasets to run econometric models such as DID, IV, and FE regression. I like to believe that that is serious enough.

    By no means do I mean that this addition should eliminate syntax. When you double click to open a dataset in Stata, you can see the syntax pop up at the bottom stating something like: use "/Users/Desktop/test.dta". In the same way, I want to be able to open data editor and simply drag a variable or observation (column or row) and have that syntax pop up. I can still document everything and reproduce exactly what have been done. This is one example of the user friendliness which I was referring to, rather than have something so basic buried in a long manual.

    This may not be the perfect analogy, but here goes: I will allow my students to use a calculator during a calculus exam, lets say to forgo having to use their time to multiply pi manually, in order to focus on solving the bigger problems that are related to the learning outcomes of the calculus course.

    When I use Stata in academic research or teach in the business school, I am not trying to be or produce an expert coder. I am trying to teach predictive modeling and its benefits to business profitability and economic policy.


    @wbuchanan
    I have tried something similar toPower Bi and Tabluae, but this is definitely not what I meant. The reason being is that these types of programs do not provide me with the same flexibility to apply methods from health economics to large scale business policy research questions.

    With the way that everything has developed, this is one area where Stata is stuck in the stone age.

    You can be "serious" and have a great interface. If you don't believe it yet, just wait until we meet in a conference.


    @Nick Cox
    Those laughtracks though

    Leave a comment:

Working...
X