Announcement

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

  • table1_mc can now also report the value of the test statistic

    The latest version of table1_mc is now available to download on SSC.
    Code:
    . search table1_mc
    The main alteration is the addition of the statistic option, allowing the value of the test statistic to also be reported:
    Code:
    . sysuse auto, clear
    . generate much_headroom = (headroom>=3)
    . table1_mc, by(foreign) vars(weight contn %5.0f \ price contln %5.0f %4.2f \ mpg conts %5.0f \ rep78 cate \ much_headroom bin) onecol test statistic 
    
      +--------------------------------------------+
      | factor               N_0   N_1   m_0   m_1 |
      |--------------------------------------------|
      | Weight (lbs.)         52    22     0     0 |
      |--------------------------------------------|
      | Price                 52    22     0     0 |
      |--------------------------------------------|
      | Mileage (mpg)         52    22     0     0 |
      |--------------------------------------------|
      | Repair record 1978    48    21     4     1 |
      |--------------------------------------------|
      | much_headroom         52    22     0     0 |
      +--------------------------------------------+
       N_ ... #records used below,   m_ ... #records not used
     
      +----------------------------------------------------------------------------------------------------------+
      |                      Domestic        Foreign         Test                       Statistic        p-value |
      |----------------------------------------------------------------------------------------------------------|
      |                      N=52            N=22                                                                |
      |----------------------------------------------------------------------------------------------------------|
      | Weight (lbs.)        3317 (695)      2316 (433)      Ind. t test                t(72)=  6.25     <0.001  |
      |----------------------------------------------------------------------------------------------------------|
      | Price                5534 (×/1.50)   5959 (×/1.44)   Ind. t test, logged data   t(72)= -0.74      0.46   |
      |----------------------------------------------------------------------------------------------------------|
      | Mileage (mpg)        19 (17-22)      25 (21-28)      Wilcoxon rank-sum          Z= -3.10          0.002  |
      |----------------------------------------------------------------------------------------------------------|
      | Repair record 1978                                   Fisher's exact             N/A              <0.001  |
      |    1                 2 ( 4%)         0 ( 0%)                                                             |
      |    2                 8 (17%)         0 ( 0%)                                                             |
      |    3                 27 (56%)        3 (14%)                                                             |
      |    4                 9 (19%)         9 (43%)                                                             |
      |    5                 2 ( 4%)         9 (43%)                                                             |
      |----------------------------------------------------------------------------------------------------------|
      | much_headroom        35 (67%)        8 (36%)         Chi-square                 Chi2(1)=  6.08    0.014  |
      +----------------------------------------------------------------------------------------------------------+
    Data are presented as mean (SD) or geometric mean (×/geometric SD) or median (IQR) for continuous measures, and n (%) for categorical measures.

  • #2
    Very useful option, thank you !!

    Comment


    • #3
      great!!!!

      Comment

      Working...
      X