Hi all,
I'm using the collect feature after table to modify the result.
I have more than 10 commands in my table.
After using the collect to modify the labels, Stata re-order the rows (1 10 11 12 2 3 4 5 6 7 8 9).
Is there a possibility to keep the ordering form 1 to 12?
I'm using stata-17:
table (command) (result), ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic had_partner x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic had_sex x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic df3mdd_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic yf3mdd_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic df401_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic yf401_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic df411_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic yf411_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic wish_to_die x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic thought_suicid x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic plan_suicid x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic try_suicid x)
collect label levels command 1 "had partner" ///
2 "had sex" ///
3 "df3mdd" ///
4 "yf3mdd" ///
5 "df401" ///
6 "yf401" ///
7 "df411" ///
8 "yf411" ///
9 "wish to die" ///
10 "thought suicid" ///
11 "plan suicid" ///
12 "try suicid" , replace
-----------------------------------
odds_ratio pvalue
-----------------------------------
had partner 0.799 0.00
thought suicid 1.128 0.06
plan suicid 1.054 0.56
try suicid 0.868 0.29
had sex 0.769 0.00
df3mdd 1.006 0.92
yf3mdd 0.917 0.42
df401 0.972 0.73
yf401 1.057 0.53
df411 1.070 0.52
yf411 1.203 0.16
wish to die 1.086 0.17
-----------------------------------
Thanks
I'm using the collect feature after table to modify the result.
I have more than 10 commands in my table.
After using the collect to modify the labels, Stata re-order the rows (1 10 11 12 2 3 4 5 6 7 8 9).
Is there a possibility to keep the ordering form 1 to 12?
I'm using stata-17:
table (command) (result), ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic had_partner x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic had_sex x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic df3mdd_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic yf3mdd_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic df401_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic yf401_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic df411_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic yf411_di x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic wish_to_die x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic thought_suicid x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic plan_suicid x) ///
command( odds_ratio = r(table)[1,1] pvalue = r(table)[4,1]: logistic try_suicid x)
collect label levels command 1 "had partner" ///
2 "had sex" ///
3 "df3mdd" ///
4 "yf3mdd" ///
5 "df401" ///
6 "yf401" ///
7 "df411" ///
8 "yf411" ///
9 "wish to die" ///
10 "thought suicid" ///
11 "plan suicid" ///
12 "try suicid" , replace
-----------------------------------
odds_ratio pvalue
-----------------------------------
had partner 0.799 0.00
thought suicid 1.128 0.06
plan suicid 1.054 0.56
try suicid 0.868 0.29
had sex 0.769 0.00
df3mdd 1.006 0.92
yf3mdd 0.917 0.42
df401 0.972 0.73
yf401 1.057 0.53
df411 1.070 0.52
yf411 1.203 0.16
wish to die 1.086 0.17
-----------------------------------
Thanks

Comment