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
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
Below, I show how we can use this option for reporting the Chi2 test value. Please note that Stata regression commands
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)')
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.