Hi everyone,
I am trying to neatly export the results from this expression to excel, preferably with the putexcel command, so that I can add details from within stata.
svy: tabulate h33117_2_3c XALTER_3c, col
Eventually the h33117_* variables will be replaced by globals and I will loop through several variables, saving results below each other. And I will also change the XALTER_3c for other variables and save it in different sheets.
When I exported regression results with putexcel, this could be done very comfortably. So, I would like to do the same, but this time I cannot seem to get the results, I assume it has to do with the weights. I am aiming for something like this (except I am aware, there is no matrix saved). The output needs to be percent of h33117_* within each group of XALTER_3c. I don't care if this is done with a different command than tabulate, but all other commands I tried so far, did not give me that output or were not compatible with weights.
putexcel set ${OUTPUT}Impulse2025, sheet(Alter) replace
local row = 1
foreach var in $h33117vars {
local varlabel : variable label `var'
putexcel A`row' = "`varlabel'", bold
local row = `row' + 1
svy: tabulate `var'_3c XALTER_3c, col
putexcel A`row' = matrix(r)
local row = `row' + 10
}
Thank you for your help!
Katrina
I am trying to neatly export the results from this expression to excel, preferably with the putexcel command, so that I can add details from within stata.
svy: tabulate h33117_2_3c XALTER_3c, col
Eventually the h33117_* variables will be replaced by globals and I will loop through several variables, saving results below each other. And I will also change the XALTER_3c for other variables and save it in different sheets.
When I exported regression results with putexcel, this could be done very comfortably. So, I would like to do the same, but this time I cannot seem to get the results, I assume it has to do with the weights. I am aiming for something like this (except I am aware, there is no matrix saved). The output needs to be percent of h33117_* within each group of XALTER_3c. I don't care if this is done with a different command than tabulate, but all other commands I tried so far, did not give me that output or were not compatible with weights.
putexcel set ${OUTPUT}Impulse2025, sheet(Alter) replace
local row = 1
foreach var in $h33117vars {
local varlabel : variable label `var'
putexcel A`row' = "`varlabel'", bold
local row = `row' + 1
svy: tabulate `var'_3c XALTER_3c, col
putexcel A`row' = matrix(r)
local row = `row' + 10
}
Thank you for your help!
Katrina
Comment