Hello everyone,
I would like to run a loop of 10 logit regressions following more or less the example provided in 1379714-help-on-writing-a-loop-for-multiple-regressions where:
logit y x1
logit y x1 x2
logit y x1 x2 x3
logit y x1 x2 x3 x4
logit y x1 x2 x3 x4 x5
logit y x1 x2 x3 x4 x5 x6
logit y x1 x2 x3 x4 x5 x6 x7
logit y x1 x2 x3 x4 x5 x6 x7 x8
logit y x1 x2 x3 x4 x5 x6 x7 x8 x9
logit y x1 x2 x3 x4 x5 x6 x7 x8 x10
[/CODE]
And thus I followed the code suggested in the post:
I would like to weigh each of these 10 regressions by the pseudo R^2 of each one to make a table in the end with maximum, minimum and average coefficients. I've tried running:
But it offers an obvious code of
I think (honestly not very sure at this point) that what I'm doing wrong is that the pseudo R^2 is not associated with each variable v but to the whole model in general, but I don't know how to create a local for all of the 10 regressions models. Do I need to create a local for each of the 10 models? If yes, how do I do this?
I'd appreciate it if anyone has any advice on how to do this.
Thanks,
Jonas
I would like to run a loop of 10 logit regressions following more or less the example provided in 1379714-help-on-writing-a-loop-for-multiple-regressions where:
logit y x1
logit y x1 x2
logit y x1 x2 x3
logit y x1 x2 x3 x4
logit y x1 x2 x3 x4 x5
logit y x1 x2 x3 x4 x5 x6
logit y x1 x2 x3 x4 x5 x6 x7
logit y x1 x2 x3 x4 x5 x6 x7 x8
logit y x1 x2 x3 x4 x5 x6 x7 x8 x9
logit y x1 x2 x3 x4 x5 x6 x7 x8 x10
[/CODE]
And thus I followed the code suggested in the post:
Code:
local predictors x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 local regressors foreach p of local predictors { local regressors `regressors' `p' logit y `regressors' }
Code:
foreach p of local predictors { local regressors `regressors' `p' quietly logit y `regressors' local pr2_`p' = `e(r2_p)' foreach v of local earliest { local regressors `regressors' `p' logit y `regressors' [weight=pr2_`p'] } }
Code:
pr2_ not found
I'd appreciate it if anyone has any advice on how to do this.
Thanks,
Jonas
Comment