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
When only one independent variable is non stationary does it make sense to run a cointegration test?Dear Stata users, after checking the stationarity of my panel data regression model: Y = f (X1, X2,…
runmlwin cross-lev interactions and random slope specificationHello, I am fitting a multilevel logit model using runmlwin following the procedure explicated in LE…
Comparing coefficients between two ivregress modelsTo Statalist I used -gmm- to test the equality between two variables (b1, c1) in different models r…
Panel Unit Root Tests and Cointegration - Lag ProblemHello! I am a fresh Stata user and not very excellent on econometrics. My data is consisted of N=8 a…
Testing if two coefficients are statistical differentDear Stataforum, I am currently investigating the Norwegian electricity market. I am running two r…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with putexcel using corr_svy and foreach commands
Post a Comment