Announcement

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

  • #61
    Crosstabs by more than two variables

    Comment


    • #62
      Originally posted by Bader Bin Adwan View Post
      Crosstabs by more than two variables
      the -table- from version 17 and up can do this. Is there something that you are looking for specifically?

      Comment


      • #63
        Originally posted by Leonardo Guizzetti View Post

        the -table- from version 17 and up can do this. Is there something that you are looking for specifically?
        If you go to this post https://www.statalist.org/forums/for...is-with-tables and see post #6 and the response #8, it can only be done with the new command collect and it needs some preparations and its a bit hectic. I would like if it could be more simple like in SPSS
        Code:
          
         CROSSTABS /Tables=Sex By month By gov By nationality /FORMAT=AVALUE TABLES /CELLS=COUNT /COUNT ROUND CELL.
        It gives you flexibility to sort the cross tabs the way you would like in both rows and columns.

        Thanks for all the efforts to make Stata better!

        Comment


        • #64
          Please consider adding generalized variance inflation factors (GVIFs). See section 4 of these slides by John Fox.
          --
          Bruce Weaver
          Email: [email protected]
          Version: Stata/MP 18.5 (Windows)

          Comment


          • #65
            Not a big deal, and easy to work around, but it would be convenient to be able to copy a value label from one frame to another without having to copy a variable it is attached to or save the label to a temporary do file and then run that in the second frame.

            Comment


            • #66
              Apologies: My posting #54 in this thread was partially (in)correct.

              While Mata does provide a built-in gamma function (see help mf_factorial) it does not provide a built-in beta function. I just realized I had programmed the latter as my own user-written Mata function.

              My original v19 Wishlist suggestion in #54—that Stata provide both as built-in functions—still stands.

              Comment


              • #67
                I am not sure what the length of variable name supported by STATA 18. Is it still 32?

                I have recently encountered some annoying problems with long variable names (e.g., k10_causedbyphysicalhealthproblemsquestion2), which were chopped by STATA during the data import. As the variable names were generated by a system based on different stages, and the last number of the variable name represents the corresponding stage (e.g., stage 2 as from the above variable). If the last (or last few characters) were chopped, it will result in a number of variables with the same name .

                I hope STATA 19 may support longer variable name.

                Comment


                • #68
                  Names in Stata 18 can't be longer than 32 characters. Even if you don't have access to Stata 18 directly, the manuals are accessible.

                  See [U] 11.3 in https://www.stata.com/manuals/u11.pdf

                  However, your main premiss is wrong. Two or more variables can't share the same name. If you think that's happening to you, it's either a bug or a misconception.

                  Comment


                  • #69
                    Shen YANG, In the end, it is a matter of taste, but I think you are misusing the concept of variable names. To me, variable names are short like k10_physhlth_q2. Then I use variable labels and possibly variable notes for keeping further information. E.g., I could set the variable label to "k10 caused by physical health problems question 2" although I think that would be too long for making nice graphs and tables.
                    Kind regards

                    nhb

                    Comment


                    • #70
                      There is occasional pressure from users for longer variable name. To be useful a proposal should include at least two concrete details:

                      1. What would be an acceptable name length limit?

                      2. How is Stata going to find even more space to show such variable names fully in output?

                      In practice I agree with Niels Henrik Bruun. The present limit may oblige slightly cryptic names at times, but that is an incentive to make good use of the available characters and to use variable labels and characteristics otherwise.

                      Comment


                      • #71
                        Hello, I wish Stata 19 makes Panel smooth transition regression (PSTR) possible.

                        Comment


                        • #72
                          Bader Bin Adwan in #61 and #63. Such tables have been possible in Stata for some time with 3 variables. In Stata 13:
                          Code:
                          . webuse lbw, clear
                          (Hosmer & Lemeshow data)
                          
                          . table low smoke race
                          
                          --------------------------------------------------------------------------------
                                    |                   race and smoked during pregnancy                  
                          birthweig | ------- white ------    ------- black ------    ------- other ------
                          ht<2500g  | nonsmoker     smoker    nonsmoker     smoker    nonsmoker     smoker
                          ----------+---------------------------------------------------------------------
                                  0 |        40         33           11          4           35          7
                                  1 |         4         19            5          6           20          5
                          --------------------------------------------------------------------------------
                          
                          .
                          To get more variables into the table, one could use -egen group-.

                          From Stata 17, there is more flexibility:
                          Code:
                          . webuse lbw, clear
                          (Hosmer & Lemeshow data)
                          
                          . table (low smoke) (race ui)
                          
                          --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                      |                                                                         Race                                                                      
                                                      |                 White                                Black                                Other                                Total              
                                                      |    Presence, uterine irritability       Presence, uterine irritability       Presence, uterine irritability       Presence, uterine irritability  
                                                      |          0          1         Total           0          1         Total           0          1         Total           0          1         Total
                          ----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------
                          Birthweight<2500g           |                                                                                                                                                  
                            0                         |                                                                                                                                                  
                              Smoked during pregnancy |                                                                                                                                                  
                                Nonsmoker             |         37          3            40          10          1            11          31          4            35          78          8            86
                                Smoker                |         28          5            33           4                        4           6          1             7          38          6            44
                                Total                 |         65          8            73          14          1            15          37          5            42         116         14           130
                            1                         |                                                                                                                                                  
                              Smoked during pregnancy |                                                                                                                                                  
                                Nonsmoker             |          3          1             4           3          2             5          16          4            20          22          7            29
                                Smoker                |         15          4            19           6                        6           2          3             5          23          7            30
                                Total                 |         18          5            23           9          2            11          18          7            25          45         14            59
                            Total                     |                                                                                                                                                  
                              Smoked during pregnancy |                                                                                                                                                  
                                Nonsmoker             |         40          4            44          13          3            16          47          8            55         100         15           115
                                Smoker                |         43          9            52          10                       10           8          4            12          61         13            74
                                Total                 |         83         13            96          23          3            26          55         12            67         161         28           189
                          --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                          Kind regards

                          nhb

                          Comment


                          • #73
                            The option of adding addplot to all built in plot types. Sometimes its useful to have this option. For example, imagine wanting to make bar graphs with confidence intervals. Using twoway to plot the graph for many categories takes up time but by using something like hbar or bar can help save on time and make it easier to include rspike etc.

                            Comment


                            • #74
                              Fahad Mirza Not speaking on behalf of StataCorp, naturally, but as a user of graph the gap between graph bar and its siblings and graph twoway looks unbridgeable to me.

                              Bar graphs with confidence intervals -- otherwise known as detonator plots, dynamite plots and plunger plots -- are widely deprecated, but those who want them have a clear Stata path through twoway bar and twoway rcap or twoway rspike. The lack of over() options isn't fatal, as either by() or some simple work-around accommodates the most common desires.

                              Comment


                              • #75
                                Nick Cox in #70

                                1. What would be an acceptable name length limit?

                                500 characters

                                2. How is Stata going to find even more space to show such variable names fully in output?

                                Truncate them (which I think it does already?)

                                The issue of incentives is not relevant. I'm paying for software, I want features that fit my use case. Dealing with variable name length issues is a huge waste of time that could easily be resolved with no penalty to users who stay within the current limit.

                                Comment

                                Working...
                                X