Attaullah Shah
Moderator
Post count: 70

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.