Hi there,
I am running a loop with multiple ttest comparisons. I want to output the means, SE's, and p-values to Excel. I have figured how to do this successfully. However, I am using a separate line of the "putexcel" command. I realize this opens and closes Excel and makes for a very slow do file. Is there a way to combine multiple actions with putexcel to avoid opening and closing it 8x for something relatively simple?
I am running a loop with multiple ttest comparisons. I want to output the means, SE's, and p-values to Excel. I have figured how to do this successfully. However, I am using a separate line of the "putexcel" command. I realize this opens and closes Excel and makes for a very slow do file. Is there a way to combine multiple actions with putexcel to avoid opening and closing it 8x for something relatively simple?
Code:
local row = `row'+1 putexcel B`row' = "Decrease group Avg=", right local m1 = r(mu_1) putexcel C`row'= `m1' local row = `row'+1 putexcel B`row' = "SE =", right local se1 = (r(sd_1))/sqrt(r(N_1)) putexcel C`row'= `se1' local row = `row'+1 putexcel B`row' = "Increase group Avg=", right local m2 = r(mu_2) putexcel C`row'= `m2' local row = `row'+1 putexcel B`row' = "SE =", right local se2 = (r(sd_2))/sqrt(r(N_2)) putexcel C`row'= `se2' local row = `row'+2
Comment