Announcement

Collapse
No announcement yet.
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • On a related note, I wish python (specifically pandas) had Stata's [_n-1] notation.

    When I learned R for the first time (or Stata for that matter) I tried to do almost everything with loops. Loops are my comfort zone, I learned them early in my programming career, write them very quickly, and they make a lot of sense to me, but they definitely are not always the best way to do things in a vectorized language. I wrote a project in Swift for the first time and kept finding myself wishing the UI elements behaved more like C#'s forms interface. That feeling that "I wish this language was more like a language I'm really familiar with" is very common, especially for beginners. In my experience it takes at least a year of regular practice before that feeling starts to go away. Python is missing a function composition operator and I bet most native python "speakers" don't even notice the feature is missing because it isn't how you do things in python.

    You can always use python in Stata or do your data preprocessing directly in python if that's what you are used to.
    Last edited by Daniel Schaefer; 11 Aug 2024, 08:11.

    Comment


    • Trend analysis facilitating annual percentage change and average annual percentage change, like National Cancer Institute Joinpoint regression program.
      Sincerely regards,
      Abdullah Algarni
      [email protected]

      Comment


      • When importing a large dataset from another format (e.g. SAS) it would be convenient for the import ____ command to offer a compress option. E.g. instead of
        Code:
        import sasexport5 filename
        compress
        one would have
        Code:
        import sasexport5 filename, compress

        Comment


        • Originally posted by John Mullahy View Post
          When importing a large dataset from another format (e.g. SAS) it would be convenient for the import ____ command to offer a compress option. E.g. instead of
          Code:
          import sasexport5 filename
          compress
          one would have
          Code:
          import sasexport5 filename, compress
          I note the first code-block requires hitting one key (Return) while the second code-block requires hitting two keys (comma and Space, the latter being optional, of course). A simple convenience option that essentially turns the second code-block into the first seems a bit unnecessary, though probably easy to implement (yourself). Do you have something different in mind? If so, how would Stata compress data it has not yet read-in?

          Comment


          • re: #334
            If so, how would Stata compress data it has not yet read-in?
            You raise a good point. I had imagined that Stata could/would pre-screen a to-be-imported file to determine variable types.

            But upon running
            Code:
            import ..., describe
            I see that it only identifies numeric variables as numeric, not byte, integer, etc. (Although, interestingly, string variables are identified as specific string types, e.g. str8, str10.) At least this was the case for the BRFSS data SAS transport file I'm using.
            https://www.cdc.gov/brfss/annual_dat...LCP2022XPT.zip

            Comment


            • Allow longer value labels for ttest (more than 8 characters, see https://www.statalist.org/forums/for...ls-using-ttest) or let ttest abbreviate value labels of the group variable.
              Last edited by Dirk Enzmann; 19 Aug 2024, 22:31.

              Comment


              • SQL beautifier (similar to the one available in PLSQL Developer) for SQL queries written in do-file editor (for example, those written for odbc load command)

                Comment


                • Allow to specify lists of variables in the missing function without using comma, e.g.
                  Code:
                  ... if mi(item1 item2 item3)
                  instead of
                  Code:
                  ... if mi(item1,item3,item3)

                  Comment


                  • I basically agree with #338, but propose a "friendly amendment." Allow -missing()- to except both the standard varlist and a comma-separated list of variables.

                    Comment


                    • "generate" and "egen" already have "before" and "after" as options; I think it would make sense to also allow "first" and "last" as options.

                      Comment


                      • I suppose it's a fair request in #340. That said, I've always preferred the explicit call to -order- as I usually find myself wanting to reorganize variables en bloc or after they have been generated as a collection to separate the processing steps.

                        Comment


                        • Insert a txt or smcl file into a PDF using putpdf

                          Background: I regularly teach statistics courses and would like my students to be able to (easily) combine their log file and saved images into one PDF document. I am aware of several third-party commands and apps that can do this, but these approaches can be cumbersome and/or distracting for students. (The results are often poorly formatted, too). This seems like something that should be baked into Stata, perhaps via the putpdf command. I like putpdf's ability to create nicely formatted reports, but in some cases I would just like to create a PDF that has a mix of Stata output and figures--no fancy formatting required. If I could just insert a .txt or .smcl file into my PDF as part of putpdf, this would be huge. Seems like this should be simple, but it may be harder that it sounds.

                          I would welcome alternative ideas that don't involve third-party commands/apps (or require markdown or Latex, etc) and hope Stata will take this suggestion for the putpdf command.

                          Thanks,
                          Sean Corcoran

                          Comment


                          • Originally posted by Sean Corcoran View Post
                            Insert a txt or smcl file into a PDF using putpdf

                            Background: I regularly teach statistics courses and would like my students to be able to (easily) combine their log file and saved images into one PDF document. I am aware of several third-party commands and apps that can do this, but these approaches can be cumbersome and/or distracting for students. (The results are often poorly formatted, too). This seems like something that should be baked into Stata, perhaps via the putpdf command. I like putpdf's ability to create nicely formatted reports, but in some cases I would just like to create a PDF that has a mix of Stata output and figures--no fancy formatting required. If I could just insert a .txt or .smcl file into my PDF as part of putpdf, this would be huge. Seems like this should be simple, but it may be harder that it sounds.

                            I would welcome alternative ideas that don't involve third-party commands/apps (or require markdown or Latex, etc) and hope Stata will take this suggestion for the putpdf command.

                            Thanks,
                            Sean Corcoran
                            I second this. Another potential solution would be a some kind of automated dyndoc where the code/log/image outputs are automatically rendered in dyndoc - even if it wasn't written using dyndoc. (Sort of like how an R script can be automatically rendered into an HTML file in RStudio with the code/output/images even if it wasn't written in rmarkdown or quarto).

                            Comment


                            • #340 I don't think you need last as an option as adding a new variable as the last variable is default behaviour.

                              Comment


                              • I wrote a simple Mata interface for ChatGPT, maybe you could get some inspiration from it and include an AI API into Stata 19? Thanks!

                                Here's my post with the Mata code: https://www.statalist.org/forums/for...pt#post1763144

                                Comment

                                Working...
                                X