Forum Replies Created

Viewing 15 posts - 1 through 15 (of 76 total)
  • Author
    Posts
  • Attaullah Shah
    Moderator
    Post count: 76
    in reply to: Reg2 Template? #18478

    Yes, you understood it correctly.

    Attaullah Shah
    Moderator
    Post count: 76
    in reply to: asdocx + Histogram #18463

    Dear Kevin
    Thanks for your feedback. The error message indicates that it is caused by the Mata setting being set to matastrict on. I have fixed the issue. You may update asdocx with asdocx_update.

    Attaullah Shah
    Moderator
    Post count: 76
    in reply to: Reg2 Template? #18459

    Dear Kevin,

    Thank you for your interest in the reg2 template. The reg2 template treats the first variable as the independent variable, followed by a list of dependent variables. This is indeed documented on the reg2 page.

    It’s also important to note that Stata does not allow factor variables in the dependent variable. This is a limitation of the software and not the template itself. The reg2 template is designed to work within these constraints.

    I hope this clarifies your query. If you have any more questions or need further assistance, feel free to ask.

    Attaullah Shah
    Moderator
    Post count: 76
    in reply to: Reg2 Template? #18413

    Dear Kevin
    Thanks for the follow up and the initial query. I have now added a page for reg2, visit it to get more details about the template.

    Attaullah Shah
    Moderator
    Post count: 76

    Dear Theresa L Harm
    I have now added oneway to asdocx. Here is a working example. Do not forget to update asdocx before trying the example.

    * asdocx_update
    asdocx_update
    ⠀
    * Load example data
    webuse apple
    ⠀
    * asdocx with oneway
    asdocx oneway weight treatment, replace
    ⠀
    
    
                                   Analysis of variance
      0 |1                                2           3             4           5             6 
    ----+----------------------------------------------------------------------------------------------
      1 |Source                          SS          df            MS           F      Prob > F 
    ----+----------------------------------------------------------------------------------------------
      2 |Between groups            5295.544           3      1765.181      21.457         0.001 
      3 |Within groups              493.592           6        82.265                           
    ---------------------------------------------------------------------------------------------------
    Bartlett's equal-variances test: Chi²(3) =     1.390(3) Prob>Chi² =    0.7079
    ⠀
    
    Attaullah Shah
    Moderator
    Post count: 76

    Dear Yang,

    I’m pleased to inform you that support for pstest has been added to asdocx. You can now export pstest results using asdocx to create well-formatted tables. For examples and syntax, please visit our this page https://asdocx.com/export-pstest-table-from-stata-to-word-excel-latex-with-asdocx/.

    Attaullah Shah
    Moderator
    Post count: 76
    Attaullah Shah
    Moderator
    Post count: 76

    This feature was added to asdocx (https://fintechprofessor.com/asdocx/), see this example

    sysuse nlsw88
    asdocx tab age race, chi replace

    Attaullah Shah
    Moderator
    Post count: 76

    Hello David
    I see that you are using by() option with template(table1). As discussed here https://asdocx.com/documentations/creating-and-working-with-asdocx-template-files/table1-template-for-baseline-characteristics-of-patients-asdocx/, table1 template has a different syntax. If have a treatment variable, that must be written first, followed by other variables. Therefore, there is no by() option in template1. Here is the correct syntax.

    asdocx tab pus_cord_total28 i.mateduc_2cat i.wealth_tertile i.number_of_ANC ///
    i.bwt_3cat i.Parity_cat i.pateduc_2cat i.mothers_age_category i.Place_Birth2 ///
    i.married i.rur i.mode_birth i.childsex_2, factor(N %) by(pus_cord_total28) ///
    continuous(mean sd) template(table1) table_layout(autofit) save(omphalitis.xlsx) /// 
    replace dec(2) dect(2)

    Before using the above, do update asdocx with asdocx_update.

    Attaullah Shah
    Moderator
    Post count: 76

    I have fixed the issue with fonts and sheet name. Please note that you can specify sheet name using the option `sheet()’. See the following example:

    asdocx_update
    
    sysuse auto
    
    asdocx sum, save(a.xlsx) replace sheet(Sheet 3) font(Arial)
    
    

    Attaullah Shah
    Moderator
    Post count: 76

    Hello Kevin
    I have updated the table1 template. I hope the update fixes the errors you have mentioned. Here is a working example.

    
    asdocx_update
    
    * Use example data
    use http://fintechprofessor.com/asdocxAddins/table1.dta, clear
    
    * Export table1 with no treatment effect.
    asdocx tab immigrant bone_arthritis bone_backspin  bone_backother bone_neck /// 
           bone_fibro bone_lupus, template(table1) notreatment replace
    
                                 Table 1: Demographics
      0 |1                                                2 
    ----+----------------------------------------------------
      1 |Variables                             Total (1000) 
    ----+----------------------------------------------------
      2 |immigrant                                          
      3 | Non-Immigrant                       670 (86.118%) 
      4 | Immigrant                           108 (13.882%) 
      5 |Arthritis                                          
      6 | No arthritis                        165 (17.387%) 
      7 | Arthritis                           784 (82.613%) 
      8 |Back pain due to s~s                               
      9 | No back pain due ~n                 918 (96.733%) 
     10 | Back pain due to ~i                   31 (3.267%) 
     11 |Back pain due to o~s                               
     12 | Back pain due to ~s               1000 (100.000%) 
     13 |Neck pain                                          
     14 | No neck pain                        803 (84.615%) 
     15 | Neck pain                           146 (15.385%) 
     16 |Fibromyalgia                                       
     17 | No fibromyalgia                     923 (97.260%) 
     18 | Fibromyalgia                          26 (2.740%) 
     19 |Lupus                                              
     20 | No lupus                            944 (99.473%) 
     21 | Lupus                                  5 (0.527%) 
    ----------------------------------------------------------
    
    

    With regards to the inclusion of new statistics, I’ve taken note of your recommendations and will take them into account as soon as my schedule allows.

    Attaullah Shah
    Moderator
    Post count: 76

    Hello Kevin
    The poly option was not previously supported in asdocx. I have added it now. You can update the mrtab package using the following link. Also update asdocx, then try the following example.

     net install asdocx_mrtab, from(http://fintechprofessor.com) replace
    asdocx_update
    
    * Load some example data
    . use http://fmwww.bc.edu/RePEc/bocode/d/drugs.dta
    
    * export the mrtab output with asdocx
    asdocx  mrtab inco1-inco7, include title(Sources of income)  poly by(city) replace
    
                |  City in which the interview was   
     Sources of |             conducted              
         income |      Basel        Bern      Zurich |      Total
    ------------+------------------------------------+-----------
     0       no |        348         288         336 |        972 
     1      yes |        346         284         333 |        963 
    ------------+------------------------------------+-----------
          Total |        694         572         669 |       1935 
          Cases |        348         288         336 |        972 
    
    Valid cases:        972
    Missing cases:        0
    
    Attaullah Shah
    Moderator
    Post count: 76

    The algorithm behind tabdisp is quite complex. Initially, I did not intend to include a by() option. However, in response to your request, I have now added this feature. Please note that the output might slightly deviate from what is produced by Stata. This is currently the best achievable result. After updating asdocx, you can try the following example

    
    asdocx tabdisp when, c(bp) by(sex) concise replace
      
                                 Tabulation of bp : sex = 1
      0 |1                                                   2 
    ----+-----------------------------------------------------------------------------
      1 |Status                                             bp 
    ----+-----------------------------------------------------------------------------
      2 |Before                                            143 
      3 |After                                             153 
    ----------------------------------------------------------------------------------
    Notes:
      
       
                               Tabulation of bp : sex = Male
      0 |1                                                   2 
    ----+-----------------------------------------------------------------------------
      1 |Status                                             bp 
    ----+-----------------------------------------------------------------------------
      2 |Before                                            152 
      3 |After                                             149 
    ----------------------------------------------------------------------------------
    Notes:
    
    Attaullah Shah
    Moderator
    Post count: 76

    Hello Isabel
    I have resolved a syntax parsing issue that was present in the previous version. In the future, when reporting an issue, it would be helpful if you could also share a dummy dataset. This would allow me to replicate the issue more efficiently. To update to the most recent version, please type

    asdocx_update

    . To demonstrate that the updated version is functioning correctly with the mixed command, I have used a dataset from Stata.

    
    * Get the example dataset
    webuse productivity
    
    * Make the nested regression table with asdocx
    asdocx mixed gsp private emp hwy water other unemp || state: if unemp >5 & region == 2 , mle replace nest
    asdocx mixed gsp private emp hwy water  unemp || state: if unemp >5 & region == 2 , mle  nest
    asdocx mixed gsp private emp  water  unemp || state: if unemp >5 & region == 2 , mle  nest
    
    * The output 
    
                               Table: Regression results
      0 |1                                        2                 3                 4 
    ----+-----------------------------------------------------------------------------------------
      1 |                                       (1)               (2)               (3) 
      2 |Variables                              gsp               gsp               gsp 
    ----+-----------------------------------------------------------------------------------------
      3 |private                              0.068             0.138           0.197** 
      4 |                                   (0.095)           (0.087)           (0.093) 
      5 |emp                               1.326***          1.243***          0.974*** 
      6 |                                   (0.163)           (0.149)           (0.132) 
      7 |hwy                              -0.705***         -0.257***                   
      8 |                                   (0.095)           (0.086)                   
      9 |water                              -0.099*            -0.037            -0.003 
     10 |                                   (0.058)           (0.043)           (0.043) 
     11 |other                               0.3***                                     
     12 |                                   (0.079)                                     
     13 |unemp                                0.001                 0           -0.005* 
     14 |                                   (0.004)           (0.003)           (0.003) 
     15 |Intercept                         4.849***           2.79***           1.511** 
     16 |                                   (0.226)           (0.628)            (0.61) 
     17 |lns1_1_1:Intercept                 -13.121         -2.922***         -2.494*** 
     18 |                               (64553.719)           (0.463)           (0.446) 
     19 |lnsig_e:Intercept                -3.685***         -3.778***         -3.721*** 
     20 |                                   (0.104)           (0.109)           (0.109) 
     21 |Observations                            46                46                46 
    ----------------------------------------------------------------------------------------------
    Notes:  Standard errors are in parentheses. *** p<.01, ** p<.05, * p<.1
    
    Attaullah Shah
    Moderator
    Post count: 76

    I have fixed the issue reported by Keiji Muramatsu. This will hopefully also fix the other issues reported by Kevin. If the update does not solve the other issues, Kevin may like to post an example.

    asdocx_update
    webuse citytemp2, clear
    
    gen group=mod(_n, 3)
    
    asdocx tab region agecat if tempjan >22, by(group) replace
    
                         Tabulation of region agecat : group = 0
      0 |1                                2            3            4            5 
    ----+-----------------------------------------------------------------------------
      1 | Census Region              agecat                                        
      2 |                             19-29        30-34          35+        Total 
    ----+-----------------------------------------------------------------------------
      3 |NE                              11           28           12           51 
      4 |N Cntrl                          7           31           10           48 
      5 |South                           46           23           14           83 
      6 |West                            51           25            7           83 
      7 |Total                          115          107           43          265 
    ----------------------------------------------------------------------------------
    Notes:
      
       
                          Tabulation of region agecat : group = 1
      0 |1                                2            3            4            5 
    ----+-----------------------------------------------------------------------------
      1 | Census Region              agecat                                        
      2 |                             19-29        30-34          35+        Total 
    ----+-----------------------------------------------------------------------------
      3 |NE                              11           27           13           51 
      4 |N Cntrl                          7           30           10           47 
      5 |South                           47           22           15           84 
      6 |West                            51           24            8           83 
      7 |Total                          116          103           46          265 
    ----------------------------------------------------------------------------------
    Notes:
      
       
                          Tabulation of region agecat : group = 2
      0 |1                                2            3            4            5 
    ----+-----------------------------------------------------------------------------
      1 | Census Region              agecat                                        
      2 |                             19-29        30-34          35+        Total 
    ----+-----------------------------------------------------------------------------
      3 |NE                              10           28           12           50 
      4 |N Cntrl                          7           31           10           48 
      5 |South                           46           23           14           83 
      6 |West                            52           24            8           84 
      7 |Total                          115          106           44          265 
    ----------------------------------------------------------------------------------
    Notes:
    
    
Viewing 15 posts - 1 through 15 (of 76 total)