Announcement

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

  • #16
    Thanks to Kit Baum there is a new minor update of basetable.
    It handles a bug, where saving into an Excel file did go wrong if there were spaces in the file path and name.
    Enjoy

    PS More refinements on the way in the near future
    Kind regards

    nhb

    Comment


    • #17
      Hi Niels,

      Can you demonstrate how the basetable program can be used in survey data that has been svyset.

      Regards,

      Madu

      Comment


      • #18
        Dear Madu
        I don't think you can use -basetable- at svyset datasets, sorry
        Kind regards nhb
        Kind regards

        nhb

        Comment


        • #19
          Hi Niels,

          Thanks for your feedback, perhaps you may need to update the Remarks on the -help- file that says "The tables can of course also be used for survey analysis" to explicitly state it doesn't support survey analysis in svyset environment.

          Kind regards,

          Madu

          Comment


          • #20
            You are absolutely right. Thank you very much for your comment. And sorry for the incorrect help file.
            The help is corrected for the next update, which will be soon
            Kind regards

            nhb

            Comment


            • #21

              Thanks to Kit Baum there is a new update.
              One of the new features is requested by Sonnen Blume (Table of CI values, normal approximation):

              Code:
              . webuse lbw
              (Hosmer & Lemeshow data)
              
              . basetable smoke race(c,ci)
                
              -----------------------------------------------------------------------------------------------------
              Columns by: smoked during pregnancy          nonsmoker             smoker              Total  P-value
              -----------------------------------------------------------------------------------------------------
                                            n (%)         115 (60.8)          74 (39.2)        189 (100.0)         
                           race(white) % (95% CI)  38.3 (29.4; 47.1)  70.3 (59.9; 80.7)  50.8 (43.7; 57.9)         
                           race(black) % (95% CI)   13.9 (7.6; 20.2)   13.5 (5.7; 21.3)   13.8 (8.8; 18.7)         
                           race(other) % (95% CI)  47.8 (38.7; 57.0)   16.2 (7.8; 24.6)  35.4 (28.6; 42.3)     0.00
              -----------------------------------------------------------------------------------------------------
              For continuous variables you can now also get median + lower and upper deciles, median + min and max.
              Also the 95% ci for the geometric mean is now possible.

              Smothing data into means of neighboring values are renamed to pseudo pecentiles.
              Kind regards

              nhb

              Comment


              • #22
                Finally... Thanks Niels for this excellent update!

                Comment


                • #23
                  Thanks to Kit Baum there is a new update.
                  Underlying code is changed.
                  Fisher exact test is now an option (exact) instead of chisquare test.
                  Kind regards

                  nhb

                  Comment


                  • #24
                    Sonnen Blume
                    Sorry I didn't notice your comment on -putdocx- in #15.
                    Using -basetable- and -putdocx- can be done by
                    Code:
                    webuse lbw, clear
                    putdocx begin
                    basetable low race(c) age(%6.2f) [Young mothers #, if age < 20] race(c) age(%6.2f), missing
                    mata out = tbl.output
                    putdocx table tablename = mata(out)
                    putdocx save report, replace
                    -basetable- returns a Mata instance, where one of the properties is the Mata string matrix tbl.output.
                    Note that tbl.output can not be used as a matrix argument directly, only by assigning it to a new variable (out).
                    Last edited by Niels Henrik Bruun; 05 Jan 2021, 00:23. Reason: adding #15
                    Kind regards

                    nhb

                    Comment


                    • #25
                      Thanks to Kit Baum there is a new update.

                      Labels and value labels are no longer an requirement. Hence, it is possible to get raw reports as well.
                      Also, varlists can be used as well as varnames. So now eg batteries of questions can all be handled once making the code simpler.
                      Help is rewritten and is more detailed.
                      Styling is modified.
                      Kind regards

                      nhb

                      Comment


                      • #26
                        Thanks to Kit Baum there is new update.
                        I just discovered a minor bug in the code when reporting decentiles and min/max for continuous variables.
                        In the help file the sub option for geometric mean is now documented.
                        Also I’ve added a comment on calculation of centiles in the help file.
                        Enjoy
                        Kind regards

                        nhb

                        Comment


                        • #27
                          Thanks to Kit Baum is there a new update of basetable at SSC.
                          A bug reporting confidence intervals and in the toxl parser are remedied.
                          Kind regards

                          nhb

                          Comment


                          • #28
                            Thanks to Kit Baum there is a new update. Minor bugs are remedied.
                            Kind regards

                            nhb

                            Comment


                            • #29
                              Originally posted by Niels Henrik Bruun View Post
                              Thanks to Kit Baum there is a new update. Minor bugs are remedied.
                              Niels Henrik Bruun

                              I installed the package tried running a two-way table, but it is showing an error:

                              Code:
                              . basetable cancerRisk gender(c)
                                    basetable_parser():  3001  expected 11 arguments but received 14
                                               <istmt>:     -  function returned error
                              Maybe the package needs an update.

                              Comment


                              • #30
                                Dear Sonnen Blume.
                                Thank you for telling me.
                                However, it works by me:
                                Code:
                                . which basetable
                                C:/Users/sttp/Documents/nhb/stata/ado17/plus\b\basetable.ado
                                *! Package basetable v 0.2.6
                                *! Support: Niels Henrik Bruun, [email protected]
                                *!version 0.2.6  2021-05-24 > Bug in basetable_parser(): basetable::n_pct_by_value() not called when value ends on r. Thanks to Kasper Norman
                                *!version 0.2.6  2021-04-15 > NoTotal and NoPvalue now also for toxl
                                
                                . webuse lbw
                                (Hosmer & Lemeshow data)
                                
                                . basetable smoke age(%6.1f) race(c)
                                  
                                ---------------------------------------------------------------------------------
                                Columns by: Smoked during pregnancy   Nonsmoker      Smoker        Total  P-value
                                ---------------------------------------------------------------------------------
                                n (%)                                115 (60.8)   74 (39.2)  189 (100.0)         
                                Age of mother, mean (sd)             23.4 (5.5)  22.9 (5.0)   23.2 (5.3)     0.54
                                Race, n (%)                                                                      
                                  White                               44 (38.3)   52 (70.3)    96 (50.8)         
                                  Black                               16 (13.9)   10 (13.5)    26 (13.8)         
                                  Other                               55 (47.8)   12 (16.2)    67 (35.4)     0.00
                                ---------------------------------------------------------------------------------
                                It might be that you need to update my other packages, eg matrixtools, as well.
                                Sorry for the inconvenience.
                                Kind regards

                                nhb

                                Comment

                                Working...
                                X