Hi everyone, I'm doing a task in which I have to do cross-tab and pairwise correlations for 3 dummy variables respect to some socio-demographic variables. I'm using this command:
clear matrix
capture close
capture log close
set matsize 800
set more off
g self_assesment_dummy = 1 if (d22<=6)
replace self_assesment_dummy = 0 if self_assesment_dummy==.
*svy: tab self_assesment_dummy if target<5, ci percent
g donotknow_dummy = 1 if (d22==97)
replace donotknow_dummy = 0 if donotknow_dummy==.
*svy: tab self_assesment_dummy if target<5, ci percent
g refusal_dummy = 1 if (d22==99)
replace refusal_dummy = 0 if refusal_dummy==.
putexcel set Test1
putexcel set Test1, sheet("corrd22") replace
global socio_demographics "(a total of 20 variables)"
global SelfAssesment "self_assesment_dummy donotknow_dummy refusal_dummy "
foreach var of varlist $SelfAssesment {
foreach x of varlist $socio_demographics {
corr_svy `var' `x' [pweight=weight], sig star (0.01)
corr_svy `var' `x' [pweight=weight], sig star (0.05)
corr_svy `var' `x' [pweight=weight], sig star (0.10)
}
}
The question is: how can I report on excel all the values of the correlations in a table? (copy and past is really hard because there is a huge number of matrix generated)
Thanks in advance!
Related Posts with Problem with putexcel using corr_svy and foreach commands
Marginal effects out of rangeDear all, I would like to know your opinion about an apparently strange (to me) result: I run a sim…
Merge/Cross/Joinby/RangejoinDear experts, I have gone through the Stata FAQ and have attempted to explain my issue according to…
reghdfe and quadratic local time trendHi all, I am running a regression using "reghdfe", with state fixed effect (FE), time FE, and state…
Grouping dataHi, I am trying to group this range from 'no income to 30,000+'. Criteria is to say the average sala…
Generate dummy = 1 based on other observationsDear Statalisters, I need a dummy variable that = 1 based on other observations of my dataset. I f…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with putexcel using corr_svy and foreach commands
Post a Comment