Hi, i'm dealing with this append and i can't detect the error. The problem is that the collect gives me a table with dim 8*12 because it places the percentages as new columns, when what I need is for the percentages to be below the frequencies.
table tra_ola1 tra_ola4, ///
stat(frequency) stat(percent, across(tra_ola4)) nototal sformat("%s%%" percent)
table tra_ola3 tra_ola4, ///
stat(frequency) stat(percent, across(tra_ola4)) nototal sformat("%s%%" percent) append
collect style header result, level(hide)
collect style cell, empty(0)
collect style tex, nocentering
collect levelsof result
collect layout (tra_ola1 tra_ola3) (result#tra_ola4)
collect preview
. dataex tra_ola1 tra_ola3 tra_ola4 in 1/100 if tra_tra1 != .
----------------------- copy starting from the next line -----------------------
table tra_ola1 tra_ola4, ///
stat(frequency) stat(percent, across(tra_ola4)) nototal sformat("%s%%" percent)
table tra_ola3 tra_ola4, ///
stat(frequency) stat(percent, across(tra_ola4)) nototal sformat("%s%%" percent) append
collect style header result, level(hide)
collect style cell, empty(0)
collect style tex, nocentering
collect levelsof result
collect layout (tra_ola1 tra_ola3) (result#tra_ola4)
collect preview
. dataex tra_ola1 tra_ola3 tra_ola4 in 1/100 if tra_tra1 != .
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(tra_ola1 tra_ola3 tra_ola4) 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 0 3 3 1 1 5 0 3 3 1 1 5 0 3 3 1 1 5 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 1 2 4 end label values tra_ola1 tra_ola1 label def tra_ola1 0 "No ola 1", modify label def tra_ola1 1 "Sólo 1", modify label values tra_ola3 tra_ola3 label def tra_ola3 1 "Ola 1", modify label def tra_ola3 2 "Ola 1 y 3", modify label def tra_ola3 3 "Ola 3", modify label values tra_ola4 tra_ola4 label def tra_ola4 3 "Ola 3", modify label def tra_ola4 4 "Ola 1, 3 y 4", modify label def tra_ola4 5 "Ola 1 y 4", modify

Comment