Announcement

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

  • Maarten Buis The controls need not be dummies.

    Comment


    • #690 gives a solution that works for linear regression on panel data. More generally, you can run your estimation command -quietly- and store the estimates (-estimates store-). Then use -etable- (or the older -esttab- or -estout-) and apply its -keep()- option to show only the coefficients you are interested in.

      Comment


      • Jeff Grogger, re your second example in #689, it seems to me that -more- as a prefix command might be more consistent with other Stata commands. E.g.,

        Code:
        more: reg y treatment x1-x475, robust
        --
        Bruce Weaver
        Email: [email protected]
        Version: Stata/MP 18.5 (Windows)

        Comment


        • Bruce Weaver That would work too.

          Comment


          • Originally posted by Bruce Weaver View Post
            Jeff Grogger, re your second example in #689, it seems to me that -more- as a prefix command might be more consistent with other Stata commands. E.g.,

            Code:
            more: reg y treatment x1-x475, robust

            That's a simple wrapper:

            Code:
            *! version 1.0.0  26apr2023
            program set_more_on
                
                version 17
                
                gettoken colon zero : 0 , parse(":") quotes
                if (`"`colon'"' == ":") local 0 : copy local zero
                
                local more_was `c(more)'
                
                nobreak {
                    
                    set more on
                    
                    capture noisily break version `= _caller()' : `0'
                    local rc = _rc
                    
                    set more `more_was'
                    
                }
                
                exit `rc'
                
            end
            Example:

            Code:
            set_more_on : reg y treatment x1-x475, robust

            Comment


            • Otherwise, one can use -estimates table- or -estout-. Yet another solution is to select what you want from the return matrix r(table) into your matrix.
              Kind regards

              nhb

              Comment


              • Does Stata 18 provide standardized mean differences more readily in very basic commands like tabulate and ttest ? Maybe I am missing something, but is the user-created stddiff package the best available option?

                Comment


                • Originally posted by Tom Best View Post
                  Does Stata 18 provide standardized mean differences more readily in very basic commands like tabulate and ttest ? Maybe I am missing something, but is the user-created stddiff package the best available option?
                  Would you be looking for -esize- ? There are many types of standardized mean differences, so this may be why you haven't found a command that suits your needs.

                  Also note, there is no -stddiff- user-contributed package on SSC. Would you mind providing a source for this?

                  Comment


                  • Thank you Leonardo Guizzetti ,

                    The stddiff I am referring to is by Ahmed M. Bayoumi at the University of Toronto, available here: https://ideas.repec.org/c/boc/bocode/s458275.html . It uses the methods summarized in the following paper for both continuous and categorical variables:
                    Yang DS, Dalton JE. A Unified Approach to Measuring the Effect Size Between Two Groups Using SAS. SAS Global
                    Forum 2012. Paper 335
                    This link, found via Google Scholar, worked for me: https://citeseerx.ist.psu.edu/docume...46a391c255581b
                    When I type ssc describe stddiff into the Stata command line, information does appear for me...but not for you?
                    For standardized differences between 2 groups for a continuous variable, stddiff is a wrapper for esize twosample when the user wants to see Cohen's d or Hedge's g.

                    But I am most interested in sample-size-independent standardized differences between counts-per-category of an unordered categorical variable (e.g., differences between counts-per-category across two groups of respondents, where each category is a self-reported race/ethnicity or an aggregation of multiple subcategories of self-reported race/ethnicity). I often desire to display such standardized differences alongside chi-squared or Fisher's exact p-values. Collectively, I am under the impression that they give some quick but imperfect sense of whether the null-hypothesis of no-difference-between groups is supported, and of the magnitude of any difference between the two samples' distributions. These are nice for "Table 1 type" displays with data on many categorical and continuous variables by group.

                    In the Yang and Dalton paper above, the use of the Mahalanobis distance measure (i.e., the square root of Hotelling' T2 statistic) for standardized differences between multinomial proportions, coupled with the nice "Interpretation" section, are enticing in their brevity and similarity to the large-sample theory for comparing two group's proportions using a pooled covariance matrix. However, I cannot find peer-reviewed published work that comments on the appropriateness of using this multinomial proportion version of the Mahalanobis distance for this purpose. Despite it's hundreds of citations and intuitive nature, the Yang and Dalton article does not give such comments, and uses an unpublished (and unavailable, at least to me) 2008 work by Dalton as citation/justification. Are you aware of such peer-reviewed published work, or related reading about alternatives? Given all this, what are the chances of making such commands more readily accessible with improved documentation in future versions of Stata?

                    Thank you,

                    Tom
                    Last edited by Tom Best; 12 May 2023, 10:38.

                    Comment


                    • Originally posted by Tom Best View Post
                      Thank you Leonardo Guizzetti ,

                      The stddiff I am referring to is by Ahmed M. Bayoumi at the University of Toronto, available here: https://ideas.repec.org/c/boc/bocode/s458275.html . It uses the methods summarized in the following paper for both continuous and categorical variables:
                      Yang DS, Dalton JE. A Unified Approach to Measuring the Effect Size Between Two Groups Using SAS. SAS Global
                      Forum 2012. Paper 335
                      This link, found via Google Scholar, worked for me: https://citeseerx.ist.psu.edu/docume...46a391c255581b
                      When I type ssc describe stddiff into the Stata command line, information does appear for me...but not for you?
                      For standardized differences between 2 groups for a continuous variable, stddiff is a wrapper for esize twosample when the user wants to see Cohen's d or Hedge's g.

                      But I am most interested in sample-size-independent standardized differences between counts-per-category of an unordered categorical variable (e.g., differences between counts-per-category across two groups of respondents, where each category is a self-reported race/ethnicity or an aggregation of multiple subcategories of self-reported race/ethnicity). I often desire to display such standardized differences alongside chi-squared or Fisher's exact p-values. Collectively, I am under the impression that they give some quick but imperfect sense of whether the null-hypothesis of no-difference-between groups is supported, and of the magnitude of any difference between the two samples' distributions.

                      In the Yang and Dalton paper above, the use of the Mahalanobis distance measure (i.e., the square root of Hotelling' T2 statistic) for standardized differences between multinomial proportions, coupled with the nice "Interpretation" section, are enticing in their brevity and similarity to the large-sample theory for comparing two group's proportions using a pooled covariance matrix. However, I cannot find peer-reviewed published work that comments on the appropriateness of using this multinomial proportion version of the Mahalanobis distance for this purpose. Despite it's hundreds of citations and intuitive nature, the Yang and Dalton article does not give such comments, and uses an unpublished (and unavailable, at least to me) 2008 work by Dalton as citation/justification. Are you aware of such peer-reviewed published work, or related reading about alternatives? Given all this, what are the chances of making such commands more readily accessible with improved documentation in future versions of Stata?

                      Thank you,

                      Tom
                      Thanks for the link for -stddiff-. Indeed, I couldn't see it by searching for it. In the following example, I show how -esize- can give you the same effect size as for -stddiff-. -esize- has been around since at least Stata 16. Beyond that I don't have much to add as I tend not to use these sorts of effect sizes much.

                      Code:
                      . webuse population
                      . stddiff age, by(sex)
                      
                      ------------------------------------------------------------------------------
                                   |       sex=Female        |        sex=Male         |
                                   | Mean or N     SD or (%) | Mean or N     SD or (%) |  Std Diff
                      -------------+-------------------------+-------------------------+------------
                               age |     36.37        9.4611 |     36.97        9.5298 |   -0.06312
                      ------------------------------------------------------------------------------
                      
                      . esize twosample age, by(sex)
                      
                      Effect size based on mean comparison
                      
                                                     Obs per group:
                                                            Female =        712
                                                              Male =        288
                      ---------------------------------------------------------
                              Effect size |   Estimate     [95% conf. interval]
                      --------------------+------------------------------------
                                Cohen's d |  -.0632182    -.2001015    .0736969
                               Hedges's g |  -.0631706    -.1999511    .0736415
                      ---------------------------------------------------------

                      Comment


                      • Thanks...this helps. For categorical variables, if I assign integer values to the categories, Cohen's d is very similar to the results of stddiff for the examples I have tried (but not identical). I haven't tried to prove it mathematically, but intuitively, I think this is because both are independent of the units/scale of the data, and because the proportion-version of the Mahalanobis distance proposed by Yang and Dalton is formulaically very-similar (if not identical) to the multi-dimensional, continuous-variable version of Cohen's d.

                        Thanks again. -Tom
                        Last edited by Tom Best; 12 May 2023, 12:05.

                        Comment


                        • Is that possible to analyze VARX on Stata, please?

                          Comment


                          • minyahil alemu, welcome to Statalist. Please ask your question in a new thread and provide additional information on what you want to do, making sure that you have included a brief description of this in the title. See FAQ Advice #12 on how best to pose your question.

                            Comment


                            • Originally posted by Nobuaki Michihata View Post
                              To be able to estimate subdistribution hazard ratios with more than two groups and to perform Gray's test with Stata.
                              This is a workaround to allow the use of R package cmprsk to do Gray's test (Gray R. J. (1988), A class of K-sample tests for comparing the cumulative incidence of a competing risk, Ann. Stat. 16:1141-1154) from Stata. Stata does the Fine and Gray regression with stcrreg. https://www.statalist.org/forums/for...Here%20is%20an

                              Comment


                              • Sir Andrew Musau Can you kindly guide on the minimum sample size or observations required to conduct for Boone indicator for measuring competition?
                                Last edited by Ravindra Muley; 22 Feb 2024, 02:37.

                                Comment

                                Working...
                                X