I have a simple question regarding how to get access to the full set of parameters that belong to one single equation. To exemplify, below there is a code that fits a two-equation model using -ml-. What I want to obtain is a row vector containing all of the parameters from the mu equation (3 regressors). Is there any direct way to obtain this using the name of the equation?
I know that we can access to specific parameters using the following syntax: _b[mu:weight]. Unfortunately, I couldn't find a way to get access to the full set of parameters associated with the mu equation.
Code:
*** mynormal1_lf.ado ***
Code:
program mynormal1_lf
version 11
args lnfj mu sigma
quietly replace `lnfj' = ln(normalden($ML_y1,`mu',`sigma'))
end
Code:
*** runmynormal.do ***
Code:
. sysuse auto, clear
(1978 Automobile Data)
. ml model lf mynormal1_lf (mu: mpg = weight displacement) (sigma:)
. ml maximize
initial: log likelihood = -<inf> (could not be evaluated)
feasible: log likelihood = -10383.274
rescale: log likelihood = -292.89564
rescale eq: log likelihood = -238.45986
Iteration 0: log likelihood = -238.45986 (not concave)
Iteration 1: log likelihood = -225.48871 (not concave)
Iteration 2: log likelihood = -215.66715
Iteration 3: log likelihood = -199.18204
Iteration 4: log likelihood = -195.29955
Iteration 5: log likelihood = -195.24
Iteration 6: log likelihood = -195.2398
Iteration 7: log likelihood = -195.2398
Number of obs = 74
Wald chi2(2) = 139.21
Log likelihood = -195.2398 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
mpg | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mu |
weight | -.0065671 .0011424 -5.75 0.000 -.0088061 -.0043281
displacement | .0052808 .0096674 0.55 0.585 -.0136671 .0242286
_cons | 40.08452 1.978738 20.26 0.000 36.20627 43.96278
-------------+----------------------------------------------------------------
sigma |
_cons | 3.385282 .2782684 12.17 0.000 2.839886 3.930678
------------------------------------------------------------------------------
. di _b[mu:weight]
-.00656711
Thanks in advance for your time.
Álvaro
Stata 16.1 MP
Win10/Linux Mint 19.1
https://alvarogutyerrez.github.io/
0 Response to access to the full set of parameters of one single equation
Post a Comment