Because of the large number of regressions required, I tried to put this in a loop. However, I am unable to run the -psacalc- command within the loop as the rmax() option does not accept anything other than scalars within the parenthesis. The code I used is:
Code:
foreach num of numlist 5 (1) 16 { areg y variable1 variable2 variable3 if variable4 == `num', absorb(variable5) psacalc beta variable1 }
Code:
psacalc beta variable1, rmax(display e(r2_a)*1.3)
Is there a way to put this in a loop?
Any help would be appreciated. Thanks.
0 Response to Is there any way of using psacalc within a loop?
Post a Comment