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
How to generate different matrices based on different factors and different factors levelsmata D = (1,1,1 \ 2,1,1 \ 3,1,2 \ 4,1,2 \ 5,1,3 \ 6,1,3 \ 7,2,1 \ 8,2,1 \ 9,2,2 \ 10,2,2 \ 11,2,3 \ …
Interacting Categorical VariableDear all, I have two categorical variables that are socialclass (1=low, 2=middle, 3=high) and jobty…
rowminI would like to create a new variable which takes the minimum value in each row, (ignoring the zeros…
â as missingThe imported data replaces the missing value symbol from the original data with an "â". My goal is t…
Using regexp to extract variables from stringI have a string variable Code: People that provides a sentence about the number and type of people …
Subscribe to:
Post Comments (Atom)
0 Response to Problem with putexcel using corr_svy and foreach commands
Post a Comment