Hi
Usually I am using this command below to create table 1.
But now I want to create this table without specifying "by (sex)." Also, how can I get frequencies with percentages, as in this table I only got percentages?
Usually I am using this command below to create table 1.
Code:
preserve
cap erase table1.xlsx
table1_mc, by(sex) ///
vars( ///
Age contn %4.1f \ ///
smoking cat \ ///
education cat \ ///
income cat \ ///
bmi contn %4.1f \ ///
bmicat cat \ ///
lpa contn %4.1f \ ///
lpa2c cat \ ///
fg contn %4.1f \ ///
HbA1C_status contn %4.1f \ ///
HbA1C_ cat \ ///
fbgdm cat \ ///
BP_OUT_CALC_AVG_SYSTOLIC_BP contn %4.1f \ ///
non_hdl contn %4.1f \ ///
HANDGRIP_OUT_LEFT contn %4.1f \ ///
HANDGRIP_OUT_RIGHT contn %4.1f \ ///
mean_HANDGRIP contn %4.1f \ ///
devided_mean_HANDGRIP contn %4.1f \ ///
devided_HANDGRIP_OUT_RIGHT contn %4.1f \ ///
devided_HANDGRIP_OUT_LEFT contn %4.1f \ ///
BodyFatFFM contn %4.1f \ ///
med_diab_tab cat \ ///
med_insulin cat \ ///
med_hbp cat \ ///
) ///
total (before) percent onecol missing clear ///
saving("table1.xlsx", replace)

Comment