Hi!! I'm struggling against a combination of previously combined tables.
My objective is obtain 1 table with two panels: Ola 3 and Ola 4, with this 2 vars in rows, and mean, median & ttest in columnis for every control var.
This is my code that, obviously, it's wrong.
preserve
collect clear
local controles sexo montevideo blanco nivel_educ
local ola3 ""
local ola4 ""
foreach con of local controles {
dtable menos_impuestos destino if ola == 3 & adulto_joven == 0, ///
by(`con', notot test) ///
continuous(, statistics(mean sd)) ///
nformat(%9.2f mean sd) ///
sformat((%s) sd) ///
name(`con'3)
collect label levels ola 3 "Ola 3", modify
dtable menos_impuestos destino if ola == 4 & adulto_joven == 0, ///
by(`con', notot test) ///
continuous(, statistics(mean sd)) ///
nformat(%9.2f mean sd) ///
sformat((%s) sd) ///
name(`con'4)
local ola3 `ola3' `con'3
local ola4 `ola4' `con'4
}
collect combine ola3 = `ola3', style(right)
collect combine ola4 = `ola4', style(right)
collect dir
collect dims
collect style tex, nocentering
collect layout (var) (sexo#result montevideo#result blanco#result nivel_educ#result)
restore
Something like this but with two panels according Ola3 and Ola4 below.

Data example:
. dataex menos_impuestos destino sexo montevideo blanco nivel_educ ola adulto_joven
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
Listed 100 out of 33670 observations
Use the count() option to list more
Thanks.
My objective is obtain 1 table with two panels: Ola 3 and Ola 4, with this 2 vars in rows, and mean, median & ttest in columnis for every control var.
This is my code that, obviously, it's wrong.
preserve
collect clear
local controles sexo montevideo blanco nivel_educ
local ola3 ""
local ola4 ""
foreach con of local controles {
dtable menos_impuestos destino if ola == 3 & adulto_joven == 0, ///
by(`con', notot test) ///
continuous(, statistics(mean sd)) ///
nformat(%9.2f mean sd) ///
sformat((%s) sd) ///
name(`con'3)
collect label levels ola 3 "Ola 3", modify
dtable menos_impuestos destino if ola == 4 & adulto_joven == 0, ///
by(`con', notot test) ///
continuous(, statistics(mean sd)) ///
nformat(%9.2f mean sd) ///
sformat((%s) sd) ///
name(`con'4)
local ola3 `ola3' `con'3
local ola4 `ola4' `con'4
}
collect combine ola3 = `ola3', style(right)
collect combine ola4 = `ola4', style(right)
collect dir
collect dims
collect style tex, nocentering
collect layout (var) (sexo#result montevideo#result blanco#result nivel_educ#result)
restore
Something like this but with two panels according Ola3 and Ola4 below.
Data example:
. dataex menos_impuestos destino sexo montevideo blanco nivel_educ ola adulto_joven
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(menos_impuestos destino) byte sexo float(montevideo blanco nivel_educ ola adulto_joven) . . 1 1 0 0 1 1 . . 0 1 0 0 1 . . . 1 1 0 0 1 0 . . 1 1 0 0 1 . . . 1 1 0 0 1 . . . 1 1 0 0 3 1 . . 0 1 0 0 3 . 0 0 1 1 1 0 3 0 . . 1 1 0 0 3 . . . 1 1 0 0 3 . . . 0 1 0 0 3 . 1 1 1 1 0 1 4 1 . . 0 1 0 0 4 . 1 0 1 1 1 0 4 0 . . 1 1 0 1 4 . . . 1 1 0 0 4 . . . 0 1 0 0 4 . . . 1 1 0 1 4 . . . 1 1 0 0 1 1 . . 0 1 0 0 1 . . . 1 1 0 0 1 0 . . 0 1 0 0 1 . . . 1 1 1 0 3 1 . . 0 1 1 0 3 . 1 1 1 1 1 0 3 0 . . 0 1 1 0 3 . . . 0 1 1 0 3 . 0 0 1 1 1 1 4 1 . . 0 1 1 0 4 . 1 0 1 1 1 0 4 0 . . 0 1 1 0 4 . . . 0 1 1 0 4 . . . 1 0 0 0 1 1 . . 1 0 0 1 1 . . . 1 0 0 1 1 0 . . 1 0 0 0 1 . . . 0 0 0 0 1 . . . 1 0 1 0 3 1 0 0 1 0 1 1 3 0 . . 1 0 1 1 3 . . . 1 0 1 0 3 . . . 0 0 1 0 3 . 0 0 1 0 1 1 4 1 . . 1 0 1 1 4 . 0 0 1 0 1 1 4 0 . . 1 0 1 0 4 . . . 1 0 0 0 1 1 . . 1 0 0 1 1 0 . . 0 0 0 0 1 . . . 1 0 0 0 1 . . . 1 0 1 0 3 1 1 1 1 0 1 1 3 0 . . 0 0 1 1 3 . . . 1 0 1 0 3 . 1 0 1 0 1 0 4 1 0 0 1 0 0 0 4 0 . . 0 0 1 1 4 . . . 1 0 1 1 4 . . . 1 1 0 0 1 1 . . 0 1 0 1 1 . . . 1 1 0 1 1 0 . . 1 1 0 0 1 . . . 1 1 1 0 3 1 1 1 1 1 1 1 3 0 . . 1 1 1 0 3 . 1 1 1 1 1 1 4 1 0 0 1 1 1 1 4 0 . . 1 1 1 0 4 . . . 0 1 0 0 1 1 . . 0 1 0 0 1 . . . 1 1 0 1 1 0 . . 0 1 1 0 3 1 . . 0 1 1 0 3 . . 0 1 1 1 1 3 0 1 0 0 1 1 1 4 1 . . 0 1 1 0 4 . 1 0 1 1 1 1 4 0 . . 1 1 0 0 1 1 . . 0 1 0 0 1 . . . 0 1 0 0 1 . . . 1 1 0 0 1 0 . . 1 1 1 0 3 1 . . 0 1 1 0 3 . . . 0 1 1 0 3 . 1 1 1 1 1 1 3 0 . . 0 1 1 0 3 . 0 0 1 1 1 0 4 1 . . 0 1 1 0 4 . . . 0 1 1 1 4 . 0 0 1 1 1 1 4 0 . . 0 1 1 0 4 . . . 0 1 1 0 4 . . . 0 1 0 0 1 1 . . 1 1 0 0 1 . . . 1 1 0 0 1 0 . . 0 1 1 0 3 1 1 1 1 1 1 0 3 0 . . 0 1 1 0 4 1 1 1 1 1 1 0 4 0 . . 0 1 1 0 4 . end label values menos_impuestos menos_impuestos label def menos_impuestos 0 "Nunca justificado", modify label def menos_impuestos 1 "Siempre justificado", modify label values destino destino label def destino 0 "Destino", modify label def destino 1 "Decisión Propia", modify label values sexo sexo label def sexo 0 "Hombre", modify label def sexo 1 "Mujer", modify label values montevideo montevideo label def montevideo 0 "No", modify label def montevideo 1 "Si", modify label values blanco blanco label def blanco 0 "Otro", modify label def blanco 1 "Blanco", modify label values nivel_educ nivel_educ label def nivel_educ 0 "Baja", modify label def nivel_educ 1 "Alta", modify label values ola ola label def ola 1 "Ola 1", modify label def ola 3 "Ola 3", modify label def ola 4 "Ola 4", modify label values adulto_joven adulto_joven label def adulto_joven 0 "Adulto", modify label def adulto_joven 1 "Jóven", modify
Listed 100 out of 33670 observations
Use the count() option to list more
Thanks.

Comment