Richard Makurumidze has asked:It seems asdoc does not work with the chi (chi -square) and or (odds ratio) in logistic regression. Is this correct or am making some error?
Richard is referring to the nest option of asdoc that creates the nested regression tables. Without the nest option, asdoc produces detailed regression tables and exports odds ratio as a default option. However, with nest option, users must explicitly declare that they are interested in the ratios. This declaration is done using the eform option. In the following examples, I show how to get odd ratios with both the detailed and the nested regressions.
Reporting the odd ratios
We shall use the example data that is available on the Stata web server. The data can be downloaded by typing the following in the Stata command window.
webuse lbw, clear
Getting odd ratios in the detailed regression tables
asdoc logistic low age lwt i.race smoke ptl ht ui, replace
Getting odd ratios in the nested regression tables
asdoc logistic low age lwt i.race smoke ptl ht ui, replace nest eform
This is how the output looks like.
Reporting the Chi2
Richard’s second is related to reporting the Chi2 test value. Since asdoc tries to find the r-squared values in regression commands, it is possible that this value is not available in some commands such as in the case of logisitc regression
Users can add additional statistics to the regression table by using the add()
There is a detailed discussion on this option in the asdoc help file, which we can access by typing:
help asdoc
Below, I show how we can use this option for reporting the Chi2 test value. Please note that Stata regression commands behind several statistics in the e() macro which we can report with asdoc.
asdoc logistic low age lwt i.race smoke ui, replace nest add(Chi2, `e(chi2)')
*Add another regression
asdoc logistic low age lwt i.race smoke ptl ht ui, nest add(Chi2, `e(chi2)')
Explanation
Option add() has two elements – the text Chi2 and the macro `e(chi2)’. These two elements are separated by the comma. This is how option add works. The inputs of option add() should be added in pairs of two, each one separated by a comma.