asdocx: Export from Stata to Word, Excel, LaTeX & HTML › Forums › asdocx Forum › by() option not working in template(table1) of asdocx
Tagged: by() asdocx template table1
-
AuthorPosts
-
Dear Prof,
I am using asdocx but keep getting an error ( st_vlload(): 3300 argument out of range). I have been using asdocx for sometime and had never experienced this problem. Could you be having any idea what the problem is? I have posted my code, error message and a data example.Regards,
David M.
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) st_vlload(): 3300 argument out of range
: - function returned error * Example generated by -dataex-. For more info, type help dataex clear input byte(pus_cord_total28 mateduc_2cat wealth_tertile) double(number_of_ANC bwt_3cat) /// byte(Parity_cat pateduc_2cat mothers_age_category Place_Birth2) float married byte(rur mode_birth childsex_2) 0 1 3 1 2 0 2 1 1 0 1 1 1 0 2 2 2 . 1 2 3 2 1 2 1 2 0 1 1 2 2 1 1 2 1 1 2 1 1 0 2 3 2 2 0 2 2 1 1 2 1 1 0 1 1 2 2 1 2 2 1 1 2 1 1 0 2 3 2 2 1 2 2 1 1 1 1 2 0 1 1 2 . 0 1 1 1 1 2 1 1 0 2 3 2 2 0 2 1 1 0 1 1 2 0 1 3 2 . 0 2 1 1 0 2 1 1 0 1 1 1 2 0 1 1 1 1 1 1 1 0 2 3 2 2 2 2 5 1 1 1 1 1 0 1 3 1 . 2 1 3 2 1 2 1 2 0 1 2 2 . 1 1 2 1 1 2 1 2 0 1 1 2 2 2 2 5 1 1 2 1 1 0 1 3 2 2 0 2 1 1 0 2 1 2 0 1 3 1 . 2 1 4 2 1 1 1 2 0 1 1 2 . 0 2 1 1 1 2 1 1 0 1 3 1 2 2 1 4 1 1 2 1 2 0 1 3 2 . 1 2 2 2 1 2 1 2 0 1 3 3 . 0 1 1 1 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2 3 1 1 1 1 2 0 2 3 1 2 1 1 2 1 1 2 1 2 end label values mateduc_2cat mateduc_2cat label def mateduc_2cat 1 "None/Primary", modify label def mateduc_2cat 2 "Secondary and More", modify label values wealth_tertile wealth_tertile label def wealth_tertile 1 "Poorest", modify label def wealth_tertile 2 "Moderate", modify label def wealth_tertile 3 "Richest", modify label values number_of_ANC number_of_ANC label def number_of_ANC 1 "1. <4", modify label def number_of_ANC 2 "2. 4-7", modify label def number_of_ANC 3 "3. 8+", modify label values bwt_3cat birth_weight_cat label def birth_weight_cat 1 "1. <2.5", modify label def birth_weight_cat 2 "2. 2.5-4.0", modify label def birth_weight_cat 3 "3. >4.0", modify label values Parity_cat Parity_cat label def Parity_cat 1 "1. 1-4", modify label def Parity_cat 2 "2. 5+", modify label values pateduc_2cat pateduc_2cat label def pateduc_2cat 1 "None/Primary", modify label def pateduc_2cat 2 "Secondary and More", modify label values mothers_age_category mothers_age_category label def mothers_age_category 1 "1. 14-19", modify label def mothers_age_category 2 "2. 20-24", modify label def mothers_age_category 3 "3. 25-29", modify label def mothers_age_category 4 "4. 30-34", modify label def mothers_age_category 5 "5. 35+", modify label values Place_Birth2 Place_Birth2 label def Place_Birth2 1 "1. Health Facility Birth", modify label def Place_Birth2 2 "2. Home Birth", modify label values rur rur_lab label def rur_lab 1 "1. 1: peri-urban", modify label def rur_lab 2 "2. 2: rural", modify label values mode_birth mode_birth label def mode_birth 1 "Vaginal", modify label def mode_birth 2 "Caesarean", modify label values childsex_2 childsex_2 label def childsex_2 1 "Boy", modify label def childsex_2 2 "Girl", modify 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
. -
AuthorPosts
- You must be logged in to reply to this topic.