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
Related Posts with Quicker way to export correlation coefficients into Excel?
mi impute chained error msg: right-hand variables or weights missing values--but they are notHello, I'm using the mi impute chained command on Stata SE 15.1. After encountering the perfect pre…
Split destring and crosstabsHello Statalist, this is my first post and so I will try to follow the rules as best I can. I have …
🐛 Stata crashes on command executionThe following example demonstrates a sequence of commands that when executed crash Stata without pos…
Average over a period of timeHi All, I have been using multiple real-time devices to collect air measurements., Now that I have …
Heckman modelHello every one first: i know two ways to use Heckman test, (1) by generate dummy variable as follow…
Subscribe to:
Post Comments (Atom)
0 Response to Quicker way to export correlation coefficients into Excel?
Post a Comment