Hello, I am running correlations over hundreds of variables and storing the output of the correlation coefficients, the variable names, number of observations and the confidence interval into Excel.
Due to the number of correlations I'm running, I am wondering whether there is a quicker way for my computer to run the task. This is my current code:
quietly{
putexcel set coef3, modify
local i=0
foreach var of varlist ea_* {
foreach var2 of varlist wdi_* {
local i=`i'+1
esize unp `var'==`var2', pbcorr
return list
putexcel A`i'=`r(r_pb)' B`i'=`r(lb_r_pb)' C`i'=`r(ub_r_pb)' D`i'=`r(N_1)' E`i'="`var'" F`i'="`var2'", nformat(excelnfmt)
}
}
}
Thank you and happy holidays
0 Response to Quicker way to export correlation coefficients into Excel?
Post a Comment