I am running a fixed effects model using the -areg- command. Using Emily Oster's -psacalc-, I am looking to compute identified effect of a co-variate, say -variable1- with an rmax of 1.3 times the rmax of the controlled regression. I need to do this for multiple categories.
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:
Unfortunately, this code computes the identified effect using the default value of rmax, 1. What I am looking for is this:
which gives the error option rmax() incorrectly specified
Is there a way to put this in a loop?
Any help would be appreciated. Thanks.
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.
Comment