Dear Statalisters,
I have difficulties using the estimates table command with the keep() option and factor variables under Stata 13.1. I noticed, that if I set the base level of the factor variable to none, I get the following error message when running the . estimates table ..., keep(i.factor) command:
coefficient i.factor does not occur in any of the models
To make things clear, here is an example illustrating my problem:
coefficient i.rep78 does not occur in any of the models
I noticed that if I do not set the base level, the problem is gone. However unfortunately I need to run the regression with no base level. Setting the base level mid-regression (ibn.rep78) also solves the problem, but it is not an option because I want to specify which levels to use (2 3 4 in this example, given as a macro in the real script). Also, I must to use the keep option, because the order of the variables is important for exporting the coefficients and further manipulation by other software.
A similar problem arose in this thread too. estout was recommended solution there. That might work, but I would like to consider that as a last resort option, because I work in a corporate environment, and installing user written programs can be problematic.
I know that my needs are quite specific, and that many otherwise good workarounds are not possible because of those, so a solution would not be of much use for many people. In spite of this I would really appreciate if some of you could give it some thought.
Best regards,
Martin Stancsics
I have difficulties using the estimates table command with the keep() option and factor variables under Stata 13.1. I noticed, that if I set the base level of the factor variable to none, I get the following error message when running the . estimates table ..., keep(i.factor) command:
coefficient i.factor does not occur in any of the models
To make things clear, here is an example illustrating my problem:
Code:
sysuse auto
drop if rep78 == .
fvset base none rep78
reg price length weight i(2 3 4).rep78, nocon
estimates store est1
reg price length weight trunk i(2 3 4).rep78, nocon
estimates store est2
estimates table est*, keep(length weight trunk i.rep78) equations(1)
I noticed that if I do not set the base level, the problem is gone. However unfortunately I need to run the regression with no base level. Setting the base level mid-regression (ibn.rep78) also solves the problem, but it is not an option because I want to specify which levels to use (2 3 4 in this example, given as a macro in the real script). Also, I must to use the keep option, because the order of the variables is important for exporting the coefficients and further manipulation by other software.
A similar problem arose in this thread too. estout was recommended solution there. That might work, but I would like to consider that as a last resort option, because I work in a corporate environment, and installing user written programs can be problematic.
I know that my needs are quite specific, and that many otherwise good workarounds are not possible because of those, so a solution would not be of much use for many people. In spite of this I would really appreciate if some of you could give it some thought.
Best regards,
Martin Stancsics
Comment