Announcement

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

  • George Ford
    replied
    when you run a linear combination test (or similar) it would be nice if the value of the combination was returned (and stored).

    Leave a comment:


  • Luke Masha
    replied
    A simple tool that allows the end user to combine curves from various st cox regressions and other graphs into a single graph. basically, imagine having 4 graphs that show 4 different event curves for the same population (death, stroke, bleeding, cancer). You could plot them all separately but it'd be nice to have a tool that allows the user to quickly create a single graph that has all for curves for comparison on it. stata can currently do it but it takes a lot of steps. it'd be nice if a user could take all 4 graphs and quickly just tell state to overlay them/combine the curves on one graph.

    In fact, stata should allow users to quickly and easily combine any curve from any graph into any other graph
    Last edited by Luke Masha; 08 Feb 2023, 21:05.

    Leave a comment:


  • Chen Samulsion
    replied
    Could graph box add an option for labelling median, p25, p75 values...? And as to text(...) option in graph box, why Stata set the x axis range [0,100] ?
    https://www.statalist.org/forums/forum/general-stata-discussion/general/1313211-how-to-mark-the-upper-adjacent-value-q3-median-q1-and-lower-adjacent-value-in-box-plot
    https://www.statalist.org/forums/forum/general-stata-discussion/general/403665-labelling-box-plot-elements

    Leave a comment:


  • William Lisowski
    replied
    #613 Daniel Feenberg -

    Almost every reply in this "Wishlist" thread to any suggestion is of the form - "That isn't needed, Stata is already Turing complete".
    No. those replies suggest workarounds that some readers of the thread may not have considered, in the spirit of being helpful and providing a forum in which readers can learn from the experiences of others.

    I hope this doesn't give Statacorp the impression that no one other than the original poster favors any of the suggestions in the Wishlist, but I fear that it does.
    Your "fear" suggests a lack of faith in the professionalism in the Stata developers. My experience does not support that. I think they're capable of getting what they need from this thread as it stands.

    Perhaps some mechanism that didn't clutter the mailing list for showing support could be implemented? A vote counter of some sort?
    Oh, please, no. Stata development isn't a popularity contest. A camel is a horse that was designed by a focus group. I prefer a product with a consistent vision that surprises me with commands like frames, the new table, and collect, that meet needs I didn't know I had in ways beyond what I would have envisioned.

    Leave a comment:


  • Leonardo Guizzetti
    replied
    Originally posted by Daniel Feenberg View Post
    -frapply- does have the advantage of being about 3 times as fast, or at least it was in an experiment I just ran. A bigger issue is that -if-, -in- and varlist are (nearly) language wide standards. Using a different syntax for -save- and -use- lacks a business purpose. Uniformity and consistency will ease learning and shorten programs.
    I don't have anything against -frapply- or its author., I was simply expressing my opinion of what seemed easier to do (and read) with standard language commands. -frapply- looks like a useful command borrowing a concept from R, but it also contradicts your desire to have uniformity and consistency by introducing "pipes" into the syntax, which are a foreign concept to the Stata and Mata languages.

    I did not have this experience that -frapply- was faster, it was consistently ~50% slower than the equivalent frame commands with this toy example. Further, -frame put- already supports -if- and -in-.

    Code:
    sysuse auto, clear
    
    timer on 1
    frapply in 1/30 if price > 6000: keep price |> save hiprice1, replace
    timer off 1
    
    sysuse auto, clear
    
    timer on 2
    frame put price in 1/30 if price > 6000, into(hi)
    frame hi: save hiprice2, replace
    frame drop hi
    timer off 2
    
    timer list
    Result

    Code:
    . timer list
       1:      0.02 /        1 =       0.0230
       2:      0.02 /        1 =       0.0160
    Originally posted by Daniel Feenberg View Post
    I would like to endorse the original suggestion by Kolev that the -save- statement be upgraded with the same qualifiers that most other non-I/O commands recognize. I/O commands -insheet-, -outsheet- -xmluse-, -import sasxport- and -save- don't allow any of those (the -varlist- option in -infile- does something different). The new -import delimited- replacement for insheet has -rowrange- (a limited -in-) and -colrange- (a limited varlist). I fear Stata that may be a policy for new procedures leaving us with two competing standards within the same language.
    Agreed, there's nothing wrong with upgrading such commands to have more similar syntax so that there is consistency.

    Leave a comment:


  • Daniel Feenberg
    replied
    Originally posted by Leonardo Guizzetti View Post
    I don’t find this use of frapply to be any more clear or succinct than the few equivalent lines of Stata code that would be required. Also, it’s dangerous to combine in and if modifiers in the same command as they do not always play nicely together or as one may expect.
    -frapply- does have the advantage of being about 3 times as fast, or at least it was in an experiment I just ran. A bigger issue is that -if-, -in- and varlist are (nearly) language wide standards. Using a different syntax for -save- and -use- lacks a business purpose. Uniformity and consistency will ease learning and shorten programs.

    I would like to endorse the original suggestion by Kolev that the -save- statement be upgraded with the same qualifiers that most other non-I/O commands recognize. I/O commands -insheet-, -outsheet- -xmluse-, -import sasxport- and -save- don't allow any of those (the -varlist- option in -infile- does something different). The new -import delimited- replacement for insheet has -rowrange- (a limited -in-) and -colrange- (a limited varlist). I fear Stata that may be a policy for new procedures leaving us with two competing standards within the same language.

    Almost every reply in this "Wishlist" thread to any suggestion is of the form - "That isn't needed, Stata is already Turing complete". There isn't any way to offer support for a suggestion, other than a new message, which is less than optimal. I hope this doesn't give Statacorp the impression that no one other than the original poster favors any of the suggestions in the Wishlist, but I fear that it does. Perhaps some mechanism that didn't clutter the mailing list for showing support could be implemented? A vote counter of some sort?

    Leave a comment:


  • Haoran Liu
    replied
    Auto fill.

    e.g., I just tried to read a csv file into Stata,

    Code:
    import delimited using "xxx.csv", clear
    but I found it takes too long to read, so I'd just read the first 10 rows. Then I tried another option, but I can only recall the grammar vaguely

    Code:
    import delimited using "xxx.csv", clear row???
    If Stata can tell me the correct grammar should be

    Code:
    rowrange([start][:end])
    it would be really nice, so I don't have to check the help.
    Last edited by Haoran Liu; 01 Feb 2023, 17:10.

    Leave a comment:


  • Bruce Weaver
    replied
    As discussed in this thread, there is no direct and easy way to use some of the alternative covariance structures (ACSs) Lesa Hoffman illustrates in Chapter 4 of her 2015 book on Longitudinal Analysis. I would like to see more ACS options for -mixed- similar to the options available in both SAS and SPSS. Cheers,
    Bruce

    Leave a comment:


  • Gorkem Aksaray
    replied
    Leonardo Guizzetti Fair enough. I personally like to be able to manipulate current frame and put it somewhere else (as I can in R or Python) without the frames housekeeping. OP was about saveing in one line instead of in multiple lines. Also, you may be right about the in and if modifiers, but those directly come from frame put, which is an official command.

    Leave a comment:


  • Leonardo Guizzetti
    replied
    I don’t find this use of frapply to be any more clear or succinct than the few equivalent lines of Stata code that would be required. Also, it’s dangerous to combine in and if modifiers in the same command as they do not always play nicely together or as one may expect.

    Leave a comment:


  • Miguel Henry
    replied
    Sparse matrix capabilities (e.g., dgCMatrix)as a built-in command.

    William Gould's book (https://journals.sagepub.com/doi/epu...36867X19874262) discusses sparse matrices on pp. 736 and 737 but as a guide to implementing sparse matrices rather than providing a built-in Stata sparse matrix command.

    Leave a comment:


  • Gorkem Aksaray
    replied
    Joro Kolev

    Originally posted by Joro Kolev View Post
    The -save- command is fairly primitive, all one can do is save the whole dataset at hand. It would be very helpful if -save- is made more multifunctional like - use [varlist] [if] [in] using filename- is.

    In particular I would like to be able to

    1. Save only particular variables from my dataset.

    2. Save only particular observations from my dataset, specified in the "if" and "in" conditions.
    This could be a replacement until we have a more able save command:

    Code:
    ssc install frapply
    sysuse auto, clear
    frapply in 1/30 if price > 6000: keep price |> save hiprice

    Leave a comment:


  • Joro Kolev
    replied
    The -save- command is fairly primitive, all one can do is save the whole dataset at hand. It would be very helpful if -save- is made more multifunctional like - use [varlist] [if] [in] using filename- is.

    In particular I would like to be able to

    1. Save only particular variables from my dataset.

    2. Save only particular observations from my dataset, specified in the "if" and "in" conditions.

    Leave a comment:


  • FernandoRios
    replied
    #604
    I usually rely on the r(table) after margins.
    My main reason for this, of course, was as a request I m often asked. How to save "event studies outputs" after csdid.
    My solution was to give people the option to store results without losing the main Equation output.
    Just wished it was an official option!

    Leave a comment:


  • John Mullahy
    replied
    re: #603. Just last week I stumbled on the fact that –margins– stores its results in r(b) without posting.
    Code:
    sysuse auto
    qui reg price mpg i.foreign
    margins, dydx(*)
    matrix bmarg=r(b)
    matrix list bmarg
    Code:
    . sysuse auto
    (1978 automobile data)
    
    . qui reg price mpg i.foreign
    
    . margins, dydx(*)
    
    Average marginal effects                                    Number of obs = 74
    Model VCE: OLS
    
    Expression: Linear prediction, predict()
    dy/dx wrt:  mpg 1.foreign
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             mpg |  -294.1955   55.69172    -5.28   0.000    -405.2417   -183.1494
                 |
         foreign |
        Foreign  |   1767.292    700.158     2.52   0.014     371.2169    3163.368
    ------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    
    . matrix bmarg=r(b)
    
    . matrix list bmarg
    
    bmarg[1,3]
                            0b.          1.
               mpg     foreign     foreign
    y1  -294.19553           0   1767.2922

    Leave a comment:

Working...
X