Following most estimation commands in Stata (e.g. reg
, logit
, probit
, etc.) one may access the estimates using the _b[ParameterName]
syntax (or the synonymous _coef[ParameterName]
). For example:
regress y x
followed by
di _b[x]
will display the estimate of the coefficient of x. di _b[_cons]
will display the coefficient of the estimated intercept (assuming the regress
command was successful), etc.
But if I use the nonlinear least squares command nl
I (seemingly) have to do something slightly different. Now (leaving aside that for this example model there is absolutely no need to use a NLLS regression):
nl (y = {_cons} + {x}*x)
followed by (notice the forward slash)
di _b[/x]
will display the estimate of the coefficient of x.
Why does accessing parameter estimates following nl
require a different syntax? Are there subtleties to be aware of?