I'm having trouble calculating marginal effects at different values of a variable var1 that I have included as a continuous independent variable in a logit regression along with its square as c.var1##c.var1.
For example, I've written my command as:
xi: logit depvar c.var1##c.var1 var2 var3 i.year, vce(bootstrap)
When I attempt to have STATA calculate marginal effects of var1 over a range of values of var1, STATA tells me it is inestimable. However, STATA will calculate marginal effects for var2 and var3, indicating that it is having an issue because of the squared term. The command I have used for calculating marginal effects is:
margins, dydx(var1) at(var1==(0(10)100))
Can you tell me why STATA is unable to do marginal effects for the squared term and how I might get it to work?
Many thanks.
For example, I've written my command as:
xi: logit depvar c.var1##c.var1 var2 var3 i.year, vce(bootstrap)
When I attempt to have STATA calculate marginal effects of var1 over a range of values of var1, STATA tells me it is inestimable. However, STATA will calculate marginal effects for var2 and var3, indicating that it is having an issue because of the squared term. The command I have used for calculating marginal effects is:
margins, dydx(var1) at(var1==(0(10)100))
Can you tell me why STATA is unable to do marginal effects for the squared term and how I might get it to work?
Many thanks.
Comment