Hi there,
I'm having trouble running the foreach command using paired ttest.
I have tried something like this, but it did not work:
foreach var of varlist ZLracylcarn*{
foreach i in 1 2{
ttest ZLracylcarn`i'*==ZLracylcarn`i+1'*
}
My variables at time point one are named:
ZLracylcarn_1_C0_
ZLracylcarn_1_C10_
and so on....
And my variables at time point two are named:
ZLracylcarn_2_C0_
ZLracylcarn_2_C10_
and so on....
Also, how can I export these results to excel?
Any help is very welcome.
Many thanks
Nathalie
Related Posts with Foreach paired ttest loop
Browse command and "Data editor" screenIs there a way to prevent Stata from switching to the "Data Editor" screen when the output of the "b…
Loop over variables for each observationDear Listers, I have a dataset which looks like id es1 es2 es3 es4 es5 es6 es7 es8 es9 1 1 1 1 1 1…
Will Stata for Mac make the ARM transition?Apple is rumored to be announcing a future transition away from Intel-based processors to ARM proces…
Change the unit size on Vertical AxisHi Stata Experts, I am using the code below to draw a quadratic graph. qui xtgee DV c.IV ##c.IV Co…
Code to run ttests and effect sizes on many variables at once?I have about 20 variables that I would like to conduct two sample t-tests (with unequal variances) a…
Subscribe to:
Post Comments (Atom)
0 Response to Foreach paired ttest loop
Post a Comment