Announcement

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

  • #61
    It would be convenient if the (count) operator in -collapse- accepted string variables, just as (first), (last), (firstnm), and (lastnm) do.

    Another convenience would be giving -collapse- a (distinct) operator that returned the number of distinct values taken on within each -by()- group (like the function -nvals()- in -egenmore-).
    Last edited by Clyde Schechter; 14 Jun 2021, 16:53.

    Comment


    • #62
      It would sometimes be helpful (for me, at least*) for the contract command to order the variables in the contract'ed dataset in the same order implied by the varlist that is provided rather than that of the existing variable order in the parent dataset. For instance, the current behavior is
      Code:
      cap preserve
      cap drop _all
      sysuse auto
      describe
      local vl="foreign rep78"
      contract `vl'
      list
      order `vl'
      list
      cap restore
      It would seem straightforward to have contract add an order option, e.g.
      Code:
      contract `vl', order
      Of course this is easy to do in two steps, contract then order, as in the example. But building an option into the contract command would be better.

      By contrast, note that the collapse command does change the order of the resulting dataset to that implied by the varlist.

      *Why this is useful (for me, at least): I often work with large datasets that I contract and then bring into Mata using st_data or st_view. Controlling the order of variables in the contract'ed dataset can make it easier to work with the new Mata matrixes that are created. Unsurprisingly Mata's version of contract, uniqrows(), respects the column order of its matrix argument.

      Comment


      • #63
        Add support for Julia, in parallel with the support for Python.

        Comment


        • #64
          It will be very helpful for me, if you add nostudies option for meta forestplot, subgroup(), like it is already in meta summarize, subgroup(), and runs automatically when you add 2 grouping variables in the former.

          Comment


          • #65
            Dear Statalist, I hope that Stata 18 can supply a command to combine several non-twoway plot in one graph.
            What we want is different from -graph combine-.
            We always encounter error when we want to plot two lines in one graph.
            for example,
            Code:
            sysuse auto,clear
            binscatter2 price mpg || binscatter2 price weight
            
            | invalid name
            r(198);
            
            . sysuse auto,clear
            (1978 automobile data)
            
            . binscatter2 price mpg
            
            . addplot:binscatter2 price weight
            
            binscatter2 is not a twoway plot type
            r(198);
            Now addplot is a useful command to add a plot to the existed graph, but it just surpports for adding twoway plot type.
            When the graph we want to add is not twoway plot type,it does not work.
            So I hope Stata 18 can supply a command which is similar to addplot, but can add non-twoway plot type.

            Best
            Raymond
            Last edited by Raymond Zhang; 24 Jun 2021, 04:34.
            Best regards.

            Raymond Zhang
            Stata 17.0,MP

            Comment


            • #66
              #65 I am not clear what you expect to happen if the || syntax were just to allow arbitrary graphs to be superimposed. In your example mpg and weight cover quite different ranges.
              Last edited by Nick Cox; 26 Jun 2021, 03:13.

              Comment


              • #67
                Please add support for sparse matrices in Mata. They are really needed now for dealing with large datasets. Otherwise please improve the documentation of banded matrices.

                Comment


                • #68
                  I have simple needs. I would love to be able to collapse part of my code and to add placeholders in the margins, or some sort of tag to easily navigate through the code of my projects.

                  Comment


                  • #69
                    Originally posted by Sabrina Gravel View Post
                    I have simple needs. I would love to be able to collapse part of my code and to add placeholders in the margins, or some sort of tag to easily navigate through the code of my projects.
                    Do you mean bookmarks and code folding? Those already exist in Stata 17. -search bookmarks- will link you to a Youtube video demonstrating bookmarks. Code folding works for blocks of code (e.g, macro programs, mata, python, java, loops, mata functions).

                    Comment


                    • #70
                      Originally posted by Leonardo Guizzetti View Post

                      Do you mean bookmarks and code folding? Those already exist in Stata 17. -search bookmarks- will link you to a Youtube video demonstrating bookmarks. Code folding works for blocks of code (e.g, macro programs, mata, python, java, loops, mata functions).
                      Ugh... and that's how I revealed that I am still working with Stata 15...

                      Comment


                      • #71
                        Originally posted by Sabrina Gravel View Post

                        Ugh... and that's how I revealed that I am still working with Stata 15...
                        Well at least you can still use code folding. The "old school" way to do bookmarks was just with big, attention grabbing comment blocks so you can more easily skim the file.

                        Comment


                        • #72
                          My most wanted feature: Web version of Stata
                          Next most wanted: Better functioning SEM, Text mining, R Integration

                          Comment


                          • #73
                            Please add support for MIDAS (mixed-data sampling) regression analysis. There has been a Matlab toolbox available since 2014 (https://www.mathworks.com/matlabcent...matlab-toolbox), an R package (described here: https://www.jstatsoft.org/article/view/v072i04) also available since 2014, and an Eviews implementation included in the software since version 9.5 in 2016 (http://www.eviews.com/EViews9/ev95midas.html)

                            These models are very important for people doing applied work in Economics. A good review of the application of time series methods to forecasting problems can be found in this book by Gysels and Marcellino: Applied Economic Forecasting Using Time Series Methods (https://eghysels.web.unc.edu/) which includes references of much of the relevant literature.

                            And here is one more paper reviewing some of the applications of MIDAS methods to econ forecasting:
                            Michelle T. Armesto; Kristie Engemann and Michael Owyang, (2010), Forecasting with mixed frequencies, Review, 92, (Nov), 521-536

                            Comment


                            • #74
                              Please add the option of making interactive visuals. I remember Robert Grant working on Stata2D3 but it seems that project has been on hold since 2 years now.

                              Comment


                              • #75
                                Agreed with #74 that easier interactive visuals would be a great addition to Stata's graphics suite. However, the introduction of SVG exporting for graphs made interactive visualization very doable with native Stata functionalities. All it requires is a working knowledge of JavaScript and regular expressions. For instance:

                                Code:
                                clear *
                                sysuse auto
                                gen label = make+": $"+strofreal(price)+", "+strofreal(length)+"in."
                                
                                twoway scatter price length if foreign, mla(label) mlabpos(12) scheme(s1mono) msym(circle)
                                gr export graph.svg, as(svg) replace 
                                gen x = fileread("Graph.svg") in 1
                                
                                replace x = ustrregexra(x,`"(?s)(?:<circle (cx="(?:([0-9]+)(?:\.([0-9]+)){0,1})" cy="(?:([0-9]+)(?:\.([0-9]+)){0,1})" r="[0-9]{1,}(?:\.[0-9]+)?")( style="fill:#([0-9A-Za-z]{6})")?(\/>[\s]+)(<circle cx="(?:[0-9]+(?:\.[0-9]+){0,1})" cy="(?:[0-9]+(?:\.[0-9]+){0,1})" r="[0-9]{1,}(?:\.[0-9]+)?" (?:style="fill:none;stroke:#[0-9A-Za-z]{6};stroke-width:[0-9]{1,}(?:\.[0-9]+)?")?\/>[\s]+)(<text )((x="(?:([0-9]+)(?:\.([0-9]+)){0,1})" y="(?:([0-9]+)(?:\.([0-9]+)){0,1})" style="font-family:'[A-Z][a-z]+';font-size:[0-9]{1,}(?:\.[0-9]+)?px;fill:#[0-9A-Za-z]{6}"(?: text-anchor="middle")?)(>[^\r\n\t\f]+<\/text>)))"',`"<circle id="circle$2$3$4$5" $1 fill="#$7"$8$10id="text$13$14$15$16" $12 opacity="0" pointer-events="none"$17`=char(10)'`=char(9)'<line id="line1$2$3$4$5" x1="$2.$3" y1="$4.$5" x2="$2.$3" y2="2489.19" stroke="black" opacity="0"/>`=char(10)'`=char(9)'<line id="line2$2$3$4$5" x1="$2.$3" y1="$4.$5" x2="390.80" y2="$4.$5" stroke="black" opacity="0"/>`=char(10)'`=char(9)'<script>`=char(10)'`=char(9)'`=char(9)'<![CDATA[`=char(10)'`=char(9)'`=char(9)'var circle$2$3$4$5 = document.getElementById("circle$2$3$4$5");`=char(10)'`=char(9)'`=char(9)'var line1$2$3$4$5 = document.getElementById("line1$2$3$4$5");`=char(10)'`=char(9)'`=char(9)'var line2$2$3$4$5 = document.getElementById("line2$2$3$4$5");`=char(10)'`=char(9)'`=char(9)'var text$13$14$15$16 = document.getElementById("text$13$14$15$16");`=char(10)'`=char(9)'`=char(9)'circle$2$3$4$5.addEventListener("mouseover",function(event){`=char(10)'`=char(9)'`=char(9)'`=char(9)'text$13$14$15$16.setAttribute('opacity',1);`=char(10)'`=char(9)'`=char(9)'`=char(9)'line1$2$3$4$5.setAttribute('opacity',1);`=char(10)'`=char(9)'`=char(9)'`=char(9)'line2$2$3$4$5.setAttribute('opacity',1);`=char(10)'`=char(9)'`=char(9)'`=char(9)'circle$2$3$4$5.setAttribute('fill','#ff0000');`=char(10)'`=char(9)'`=char(9)'})`=char(10)'`=char(9)'`=char(9)'circle$2$3$4$5.addEventListener("mouseout",function(event){`=char(10)'`=char(9)'`=char(9)'`=char(9)'text$13$14$15$16.setAttribute('opacity',0);`=char(10)'`=char(9)'`=char(9)'`=char(9)'line1$2$3$4$5.setAttribute('opacity',0);`=char(10)'`=char(9)'`=char(9)'`=char(9)'line2$2$3$4$5.setAttribute('opacity',0);`=char(10)'`=char(9)'`=char(9)'`=char(9)'circle$2$3$4$5.setAttribute('fill','#$7');`=char(10)'`=char(9)'`=char(9)'})`=char(10)'`=char(9)'`=char(9)']]>`=char(10)'`=char(9)'</script>"',.)
                                
                                outfile x in 1 using Graph.svg,replace noquote
                                I can't upload .svg files here for some reason, but running this code will produce an svg file containing an interactive scatter plot of price and weight. The markers contain tooltips which, on mouseover, display information about the make of the car and its precise price and weight.

                                Admittedly this code is very messy, which is why I am on board for more user-friendly interactive visualizations for Stata 18.

                                Comment

                                Working...
                                X