Here is half a solution. The other half
is left as an exercise, as the information
is readily accessible in r() and _b[].
forval i = 2/100 {
qui reg var1 var`i'
<print selected results>
}
Nick
[email protected]
kelly johnson
> suppose i have 100 variables (var1-var100). how can i write a
> simple loop to
> regress all the variables on var1, one at a time?
>
> specifically, i want:
>
> reg var1 var2
> reg var1 var3
> .
> .
> .
> reg var1 var100
>
> additionally, how can i display ONLY the coefficients and
> their p-values of
> each regression in my log file? (all i want is a list of the relevent
> coefficients and their corresponding p-values). thank you!
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/