Announcement

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

  • @Clyde Schechter: Are you looking for something like this?

    Code:
    replace x = ustrregexra(x, "[^[:print:]]", "")

    Comment


    • That sounds interesting. I was not aware of :print: in Stata's regular expressions. Thank you!

      Comment


      • How about:

        1. Option for calculating CIs for percentages in two way tables (SPSS can do that from complex sample module).
        2. Quality of the graphs, at least half as thrilling and sophisticated as ones that ggplot2 can already do.
        3. Modifiable example charts online (https://plot.ly/)
        4. Loading SPSS files directly.
        5. Editing value labels/variable names right on the variable window, without having to type on console.
        6. Making a help menu/forum exclusively for sharing the reproducible codes/examples of analysis.

        Comment


        • #168 (2) Please give an example of a graph you want that you think Stata can't do. There are many kinds, no doubt, but StataCorp really need a more precise wish list than that.

          (5) Do you know about varm ?

          (6) Statalist exists for this purpose, and others. If you can find a way to insist that people only post reproducible problems, that would be good. It would save a lot of time and effort.

          Comment


          • Not sure if this has been mentioned, but when using the replace command with greater than (i.e. replace x=7 if y>3) missing values are also replaced since Stata treats missing as a high value. You can include code to exclude missing, but it can still be overlooked at times (see https://journals.sagepub.com/doi/pdf...03122418780369). Seems like it would be easy to fix and ensure this doesn't lead to too many problems.

            Comment


            • Originally posted by Sonnen Blume View Post
              5. Editing value labels/variable names right on the variable window, without having to type on console.
              Stata 11 introduced the variable manager and Stata 12 brought the properties window, where you can modify labels without typing commands.

              Originally posted by Leah Jones View Post
              [...] using the replace command with greater than (i.e. replace x=7 if y>3) missing values are also replaced since Stata treats missing as a high value. [...] Seems like it would be easy to fix and ensure this doesn't lead to too many problems.
              This has been discussed several times and I assume it will be discussed in the future. I believe there is nothing to "fix": this is not a bug, it is a design choice. More important, once you understood the principle, you can and probably will actually use it as a feature in your code. Changing something this basic now is likely to cause more problems (especially for those who have been working with Stata for a long time) than it would help (especially those who are new to Stata).

              Best
              Daniel
              Last edited by daniel klein; 05 Jan 2019, 02:19.

              Comment


              • daniel klein is right. This isn't a bug. It's a documented design choice. Responsibility for code remains with the coder.

                But I am curious: what would the easy fix be, precisely?

                Comment


                • One quick and dirty fix would be to add a new option to the replace command. The name of this new option could be something like "nomiss" and extend the example " replace x=7 if y>3 ,nomiss" to "replace x=7 if y>3 & !missing(y)". Alternatively, create a new command like "replacenm" (replace no miss) which has this option as its default. In this or similar way, you could get the intended effect without breaking old code, which relies on the current behaviour.
                  Maybe it would be even enough to issue a suppressible warning that missing values have also been changed. Such a warning would at least provide a hint to the coder that something might have happened which was not intended.

                  Comment


                  • Originally posted by Nick Cox View Post
                    daniel klein is right. This isn't a bug. It's a documented design choice. Responsibility for code remains with the coder.

                    But I am curious: what would the easy fix be, precisely?
                    Other packages have different ways of addressing this situation, my favorite is PSTAT where logical results can have three values, true, false or missing.

                    Comment


                    • I have heard two substantial talks on proposals for three-way logic in Stata. After each talk the discussion seemed to split three ways.

                      1. Regardless of the merits of your solution, this is way too complicated to explain either to new users or to experienced users accustomed to Stata's existing logic, in some cases experience meaning decades and not just years. The time for three-way logic to be introduced to Stata was 1984, not now.

                      2. We really don't need or want three-way logic. The present system works fine. It's not outrageous to expect people to read documentation or to look carefully at what Stata does. There are functions like missing() that do what people want.

                      3. We need a three-way logic, but your version is quite illogical.

                      Sure, that is only a sample of two talks and it's difficult to recall all of the discussion as often two or three people were speaking at the same time.

                      Comment


                      • #173 Commands that work differently can be written by users too. I find it striking that no such command seems to exist and my guess is that the more experienced you are, the more you just work with Stata's existing behaviour on this point.

                        More warnings: I think that's a good idea.

                        Comment


                        • Nick Cox , what is the best way to request from Stata Corp experts that they teach us some particular topic, say on the Stata Blog, or as an article in Stata Journal?

                          David M. Drukker (StataCorp) for example has a brilliant sequence of "Programming an estimation command in Stata" entries.

                          I would like to read such an expose on Programming a linear system estimator in Stata, which is up to date with modern Stata.

                          Comment


                          • Originally posted by Nick Cox View Post
                            #168 (2) Please give an example of a graph you want that you think Stata can't do. There are many kinds, no doubt, but StataCorp really need a more precise wish list than that.

                            (5) Do you know about varm ?

                            (6) Statalist exists for this purpose, and others. If you can find a way to insist that people only post reproducible problems, that would be good. It would save a lot of time and effort.
                            Thanks so much for your point-by-point reply!
                            varm takes to a separate window for editing. By editing label names directly on variable menu, I meant editing on the window that shows the variables and labels on the right side of the interface.


                            2& 6) Here is one example of online chart list that I use most often: https://www.surveydesign.com.au/tipsgraphs.html

                            I find Statalist extremely helpful, and perhaps the most helpful of this kind on the internet, still I find the website containing the example charts more efficient and organised. I see many contributors like Nick, Clyde end up doing too much work, everyday, and sometimes have to answer the same questions which is inefficient. This can be avoided greatly by having an online repository of codes where people can share their reproducible examples, once for all. Greater good for greater number!

                            Here are a few examples of charts offered by R that I find very useful:

                            1) Lolipop instead of bars that are more elegant to the eyes + facet wrap option by separating the bars by color that makes reading the chart a pleasure:
                            Click image for larger version

Name:	Capture3.png
Views:	1
Size:	218.4 KB
ID:	1477370





                            2) Showing the difference between two estimates:
                            Click image for larger version

Name:	Capture2.PNG
Views:	1
Size:	389.4 KB
ID:	1477371




                            3) Correlation plot:
                            Click image for larger version

Name:	Capture4.png
Views:	1
Size:	17.8 KB
ID:	1477372





                            4) Decision tree:
                            Click image for larger version

Name:	Capture4.png
Views:	1
Size:	3.6 KB
ID:	1477373




                            5) Choropleth charts:

                            Stata has the option to do so with shp file, which makes the task complex when only selected regions are aimed e.g. west africa. Having to depend on shp file is hard and can be avoided if Stata povides a built in function for this, like Excel 2019 is providing in a single click which even can recognise the country automatically from the names of the regions:
                            Click image for larger version

Name:	Capture3.png
Views:	1
Size:	78.1 KB
ID:	1477374

                            Last edited by Sonnen Blume; 05 Jan 2019, 15:15.

                            Comment


                            • #178

                              Editing variable names, labels, etc.

                              varm takes to a separate window for editing. By editing label names directly on variable menu, I meant editing on the window that shows the variables and labels on the right side of the interface.
                              I think I see what you want. That seems to go with having much bigger, or more, monitors than many of us have. Otherwise put, needing space to do such editing is why
                              Code:
                              varm
                              is the way it is.

                              Documenting good examples

                              I find Statalist extremely helpful, and perhaps the most helpful of this kind on the internet, still I find the website containing the example charts more efficient and organised. I see many contributors like Nick, Clyde end up doing too much work, everyday, and sometimes have to answer the same questions which is inefficient. This can be avoided greatly by having an online repository of codes where people can share their reproducible examples, once for all. Greater good for greater number!
                              Thanks for the positive comments. Again, my reaction is not that this would not be good, but rather that there are already many ways of providing broadly similar public resources.

                              I'll mention first the StataCorp FAQs. As should be apparent, StataCorp are entirely positive about community-contributed FAQs. A long while ago, there were suggestions that someone should monitor Statalist and encourage turning the best postings into FAQs. Long story short, this hasn't often happened, but there is no reason why people should not encourage this.

                              Now the Stata Journal. The Stata Tips are designed largely for this purpose. I'll put on a hat here as the Editor who tends to deal with those and encourage submissions. Under a related heading, I will give a couple of personal examples. Clyde Schechter and I recently tried to distill the essence of many threads on handling strings and of generating indicator variables into fairly detailed surveys (yet not, we hope, too long or too difficult for users seriously wanting to understand). The string piece came out in SJ 18(4) and the indicators piece should come out in SJ 19(1). Indeed many of the Speaking Stata columns are reactions to repeated threads on Statalist.

                              There are many ways to promote good practice. Whether we need another is a good open question.

                              Graphical requests

                              Graphs (1) (2) are already programmed or programmable easily in Stata. The desire behind (3) I've met in a different way with corrtable (SSC). I'd suggest that you post a new question on (1) and (2) which I will answer, as nothing depends on StataCorp adding future functionality.

                              (4) and (5) lie beyond my interests, so I have nothing to say; what do others think?

                              Comment


                              • #177 How best to suggest to StataCorp that they provide some resource? Use [email protected]. Nothing much is easier than forwarding an email to someone better fitted to do the job!

                                Comment

                                Working...
                                X