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?
Generating a dummy variable if a household has a migrant or not.I have household survey on data including variables 'HouseholdID' containing an ID number unique to…
Do logs modify the correlation between two variables?Dear Statalists, I am applying logs to two variables: Code: gen In_Arg_X_Bra=ln(Arg_X_Bra+1) gen…
Is multiple imputation possible with gllamm?Hi, I am using the gllamm command, a user generated command for multilevel models. I am wondering i…
Bug in Mata's st_view() function with time-series operators?I experienced an unexpected behavior of Mata's st_view() function. In the following, I want to obtai…
Split a numeric variableHi, I have a variable called "bslstart" in which the format is: 01 Jan 16 01 Dec 15 01 Sep 14 I w…
Subscribe to:
Post Comments (Atom)
0 Response to Quicker way to export correlation coefficients into Excel?
Post a Comment