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
Help with data set-upHello all- I feel like there is an easy solution to this but I just can't see how to do it. I have d…
Coefplot: Group covariates by model, and not model by covariatesI am trying to plot estimates from multiple models using coefplot. I need to group all the estimates…
rdplot weight the linear function of dependent variable by the number of observations in each binHi all, I am currently using rdplot to visualise the discontinuity of my outcome variable along the…
Delete variables that have the same number repeated across all observations with some missing values.I have a dataset with ~2500 variables named NEIS* and I want to: - Delete all variables that have th…
dcreate (efficient designs / choice experiments)Dear friends: I am working with the dcreate command to build efficient designs for choice experiment…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with putexcel using corr_svy and foreach commands
Post a Comment