[Limdep Nlogit List] Please check for me if the syntax used is ok and the results
Harold Mayaba
mayabach2009 at yahoo.com
Sat Nov 19 22:12:03 AEDT 2022
Dear Pro Greene and other Nlogit users,
Thank you very much for guiding me so far on how to use Nlogit. I'm almost ready to do my final run. But before do that, could you please check if the syntax below and the results are correct? Please give any suggestions if there is an improvement needed.
Thanks
Harold.
NLOGIT
;lhs = choice
;choices = alt1, alt2, none
;rpl= female, male, age1, age2, age3, age4, age5,inco1, inco2, inco3,inco4, inco5
;fcn= caged(n) ,acdoors(n), nprs(n|#000000000000),cert1(n|#000000000000),cert2(n|#000000000000),mmort(n|#000000000000),hmort(n|#000000000000)
;pds =10
;pts=100
;maxit=500
;describe
;pwt
;effects:caged(*)/acdoors(*)/price(*)
;full
;parameters
;halton
;effects:caged (*) / acdoors(*)/price(*)
;wtp=caged/price,acdoors/price ,nprs/price ,cert2/price
,hmort/price
;model:
U(alt1)= alt1 + caged*caged+acdoors*acdoors+nprs*nprs+cert1*cert1+cert2*cert2+mmort*mmort+hmort*hmort + price*price/
U(alt2)= alt2 + caged*caged+acdoors*acdoors+nprs*nprs+cert1*cert1+cert2*cert2+mmort*mmort+hmort*hmort + price*price/
U(None)= ASC$
Hessian is not positive definite at start values.Error 803: Hessian is not positive definite at start values.B0 is too far from solution for Newton method.Switching to BFGS as a better solution method.Iterative procedure has convergedNormal exit: 16 iterations. Status=0, F= .8519932D+04
-----------------------------------------------------------------------------Start values obtained using MNL modelDependent variable ChoiceLog likelihood function -8519.93214Estimation based on N = 9550, K = 11Inf.Cr.AIC = 17061.9 AIC/N = 1.787--------------------------------------- Log likelihood R-sqrd R2AdjConstants only ********** .1752 .1734Note: R-sqrd = 1 - logL/Logl(constants)Warning: Model does not contain a fullset of ASCs. R-sqrd is problematic. Usemodel setup with ;RHS=one to get LogL0.---------------------------------------Response data are given as ind. choicesNumber of obs.= 9550, skipped 0 obs--------+-------------------------------------------------------------------- | Standard Prob. 95% Confidence CHOICE| Coefficient Error z |z|>Z* Interval--------+-------------------------------------------------------------------- CAGED| -.87643*** .06445 -13.60 .0000 -1.00275 -.75012 ACDOORS| 1.41447 .....(Fixed Parameter)..... NPRS| .09008*** .01368 6.58 .0000 .06327 .11690 CERT1| .09144*** .00887 10.30 .0000 .07404 .10883 CERT2| .14397 .....(Fixed Parameter)..... MMORT| -.27813*** .01708 -16.28 .0000 -.31161 -.24465 HMORT| -.70977 .....(Fixed Parameter)..... ALT1| .10425 .....(Fixed Parameter)..... PRICE| -.11580 .....(Fixed Parameter)..... ALT2| .26222 .....(Fixed Parameter)..... ASC| -.36647 .....(Fixed Parameter).....--------+--------------------------------------------------------------------***, **, * ==> Significance at 1%, 5%, 10% level.Fixed parameter ... is constrained to equal the value orhad a nonpositive st.error because of an earlier problem.Model was estimated on Nov 19, 2022 at 11:24:03 PM-----------------------------------------------------------------------------
Line search at iteration101 does not improve the functionExiting optimization
-----------------------------------------------------------------------------Random Parameters Multinom. Logit ModelDependent variable CHOICELog likelihood function -6852.74433Restricted log likelihood -10491.74736Chi squared [ 42](P= .000) 7278.00605Significance level .00000McFadden Pseudo R-squared .3468443Estimation based on N = 9550, K = 42Inf.Cr.AIC = 13789.5 AIC/N = 1.444--------------------------------------- Log likelihood R-sqrd R2AdjNo coefficients ********** .3468 .3454Constants only ********** .3366 .3352At start values -8519.9321 .1957 .1939Note: R-sqrd = 1 - logL/Logl(constants)Warning: Model does not contain a fullset of ASCs. R-sqrd is problematic. Usemodel setup with ;RHS=one to get LogL0.---------------------------------------Response data are given as ind. choicesReplications for simulated probs. = 100Used Halton sequences in simulations.RPL model with panel has 955 groupsFixed number of obsrvs./group= 10Number of obs.= 9550, skipped 0 obs--------+-------------------------------------------------------------------- | Standard Prob. 95% Confidence CHOICE| Coefficient Error z |z|>Z* Interval--------+-------------------------------------------------------------------- |Random parameters in utility functions.............................. CAGED| -4.42927*** .50819 -8.72 .0000 -5.42530 -3.43324 ACDOORS| 2.41098*** .25528 9.44 .0000 1.91064 2.91132 NPRS| -.08707 .13221 -.66 .5102 -.34621 .17206 CERT1| .16443* .09518 1.73 .0841 -.02213 .35098 CERT2| .22919*** .08346 2.75 .0060 .06560 .39278 MMORT| -.54260*** .05634 -9.63 .0000 -.65301 -.43218 HMORT| -1.28818*** .06629 -19.43 .0000 -1.41811 -1.15826 |Nonrandom parameters in utility functions........................... ALT1| .40841 .4843D+07 .00 1.0000 *********** *********** PRICE| -.19728*** .00872 -22.62 .0000 -.21437 -.18018 ALT2| .61284 .4843D+07 .00 1.0000 *********** *********** ASC| -1.02125 .4843D+07 .00 1.0000 *********** *********** |Heterogeneity in mean, Parameter:Variable...........................CAGE:FEM| .17479 .33810 .52 .6052 -.48788 .83747CAGE:MAL| .02841 .19217 .15 .8825 -.34825 .40506CAGE:AGE| .08688*** .01911 4.55 .0000 .04943 .12433CAG0:AGE| .02644** .01186 2.23 .0258 .00320 .04968CAG1:AGE| .01896* .01007 1.88 .0596 -.00077 .03869CAG2:AGE| .02021*** .00726 2.78 .0054 .00598 .03444CAG3:AGE| .00668 .00879 .76 .4472 -.01055 .02391CAGE:INC| -.06425 .06038 -1.06 .2873 -.18259 .05409CAG0:INC| .01171 .01531 .76 .4444 -.01830 .04171CAG1:INC| .02242*** .00836 2.68 .0073 .00603 .03881CAG2:INC| .00504 .00622 .81 .4178 -.00715 .01724CAG3:INC| .00657 .00435 1.51 .1310 -.00196 .01510ACDO:FEM| -.30365 .20052 -1.51 .1300 -.69667 .08937ACDO:MAL| -.02947 .14078 -.21 .8342 -.30540 .24646ACDO:AGE| -.01546 .01166 -1.33 .1849 -.03830 .00739ACD0:AGE| -.00406 .00711 -.57 .5676 -.01800 .00987ACD1:AGE| -.00291 .00524 -.55 .5789 -.01318 .00737ACD2:AGE| .00139 .00446 .31 .7557 -.00736 .01013ACD3:AGE| .00062 .00453 .14 .8906 -.00826 .00951ACDO:INC| .02493 .02637 .95 .3445 -.02676 .07662ACD0:INC| -.00867 .01027 -.84 .3986 -.02879 .01146ACD1:INC| -.00153 .00600 -.26 .7983 -.01330 .01023ACD2:INC| .00207 .00372 .56 .5789 -.00523 .00936ACD3:INC| -.00339 .00267 -1.27 .2037 -.00862 .00184NPRS:FEM| 0.0 .....(Fixed Parameter).....NPRS:MAL| 0.0 .....(Fixed Parameter).....NPRS:AGE| 0.0 .....(Fixed Parameter).....NPR0:AGE| 0.0 .....(Fixed Parameter).....NPR1:AGE| 0.0 .....(Fixed Parameter).....NPR2:AGE| 0.0 .....(Fixed Parameter).....NPR3:AGE| 0.0 .....(Fixed Parameter).....NPRS:INC| 0.0 .....(Fixed Parameter).....NPR0:INC| 0.0 .....(Fixed Parameter).....NPR1:INC| 0.0 .....(Fixed Parameter).....NPR2:INC| 0.0 .....(Fixed Parameter).....NPR3:INC| 0.0 .....(Fixed Parameter).....CERT:FEM| 0.0 .....(Fixed Parameter).....CERT:MAL| 0.0 .....(Fixed Parameter).....CERT:AGE| 0.0 .....(Fixed Parameter).....CER0:AGE| 0.0 .....(Fixed Parameter).....CER1:AGE| 0.0 .....(Fixed Parameter).....CER2:AGE| 0.0 .....(Fixed Parameter).....CER3:AGE| 0.0 .....(Fixed Parameter).....CERT:INC| 0.0 .....(Fixed Parameter).....CER0:INC| 0.0 .....(Fixed Parameter).....CER1:INC| 0.0 .....(Fixed Parameter).....CER2:INC| 0.0 .....(Fixed Parameter).....CER3:INC| 0.0 .....(Fixed Parameter).....CER0:FEM| 0.0 .....(Fixed Parameter).....CER0:MAL| 0.0 .....(Fixed Parameter).....CER4:AGE| 0.0 .....(Fixed Parameter).....CER5:AGE| 0.0 .....(Fixed Parameter).....CER6:AGE| 0.0 .....(Fixed Parameter).....CER7:AGE| 0.0 .....(Fixed Parameter).....CER8:AGE| 0.0 .....(Fixed Parameter).....CER4:INC| 0.0 .....(Fixed Parameter).....CER5:INC| 0.0 .....(Fixed Parameter).....CER6:INC| 0.0 .....(Fixed Parameter).....CER7:INC| 0.0 .....(Fixed Parameter).....CER8:INC| 0.0 .....(Fixed Parameter).....MMOR:FEM| 0.0 .....(Fixed Parameter).....MMOR:MAL| 0.0 .....(Fixed Parameter).....MMOR:AGE| 0.0 .....(Fixed Parameter).....MMO0:AGE| 0.0 .....(Fixed Parameter).....MMO1:AGE| 0.0 .....(Fixed Parameter).....MMO2:AGE| 0.0 .....(Fixed Parameter).....MMO3:AGE| 0.0 .....(Fixed Parameter).....MMOR:INC| 0.0 .....(Fixed Parameter).....MMO0:INC| 0.0 .....(Fixed Parameter).....MMO1:INC| 0.0 .....(Fixed Parameter).....MMO2:INC| 0.0 .....(Fixed Parameter).....MMO3:INC| 0.0 .....(Fixed Parameter).....HMOR:FEM| 0.0 .....(Fixed Parameter).....HMOR:MAL| 0.0 .....(Fixed Parameter).....HMOR:AGE| 0.0 .....(Fixed Parameter).....HMO0:AGE| 0.0 .....(Fixed Parameter).....HMO1:AGE| 0.0 .....(Fixed Parameter).....HMO2:AGE| 0.0 .....(Fixed Parameter).....HMO3:AGE| 0.0 .....(Fixed Parameter).....HMOR:INC| 0.0 .....(Fixed Parameter).....HMO0:INC| 0.0 .....(Fixed Parameter).....HMO1:INC| 0.0 .....(Fixed Parameter).....HMO2:INC| 0.0 .....(Fixed Parameter).....HMO3:INC| 0.0 .....(Fixed Parameter)..... |Distns. of RPs. Std.Devs or limits of triangular.................... NsCAGED| 3.44339*** .15805 21.79 .0000 3.13362 3.75316NsACDOOR| 1.73423*** .08773 19.77 .0000 1.56228 1.90618 NsNPRS| 1.66764*** .07600 21.94 .0000 1.51869 1.81658 NsCERT1| .02426 .11641 .21 .8349 -.20389 .25241 NsCERT2| .17620 .19691 .89 .3709 -.20974 .56214 NsMMORT| .27013** .12051 2.24 .0250 .03393 .50633 NsHMORT| .91490*** .08583 10.66 .0000 .74667 1.08312--------+--------------------------------------------------------------------nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx.***, **, * ==> Significance at 1%, 5%, 10% level.Fixed parameter ... is constrained to equal the value orhad a nonpositive st.error because of an earlier problem.Model was estimated on Nov 19, 2022 at 11:52:01 PM-----------------------------------------------------------------------------
Parameter Matrix for Heterogeneity in Means.Matrix DELTA_RP is displayed in project window.Saved Individual Estimates of WTP in matrix WTP_I [ 955x5]Alternative Attribute Income/Cost Chosen CAGED PRICE Chosen ACDOORS PRICE Chosen NPRS PRICE Chosen CERT2 PRICE Chosen HMORT PRICE(Saved absolute values. Check signs of coefficients.)+-------------------------------------------------------------------------+| Descriptive Statistics for Alternative ALT1 || Utility Function | (CBS wt = 1.00000) | 2523.0 observs. || Coefficient | All 9550.0 obs.|that chose ALT1 || Name Value Variable | Mean Std. Dev.|Mean Std. Dev. || ------------------- -------- | -------------------+------------------- || CAGED -4.4293 CAGED | .338 .473| .122 .328 || ACDOORS 2.4110 ACDOORS | .269 .443| .589 .492 || NPRS -.0871 NPRS | .795 .404| .932 .251 || CERT1 .1644 CERT1 | .266 .442| .372 .483 || CERT2 .2292 CERT2 | .571 .495| .657 .475 || MMORT -.5426 MMORT | .234 .424| .187 .390 || HMORT -1.2882 HMORT | .442 .497| .319 .466 || ALT1 .4084 ONE | 1.000 .000| 1.000 .000 || PRICE -.1973 PRICE | 8.470 3.425| 8.673 3.088 |+-------------------------------------------------------------------------++-------------------------------------------------------------------------+| Descriptive Statistics for Alternative ALT2 || Utility Function | (CBS wt = 1.00000) | 3076.0 observs. || Coefficient | All 9550.0 obs.|that chose ALT2 || Name Value Variable | Mean Std. Dev.|Mean Std. Dev. || ------------------- -------- | -------------------+------------------- || CAGED -4.4293 CAGED | .507 .500| .239 .426 || ACDOORS 2.4110 ACDOORS | .363 .481| .618 .486 || NPRS -.0871 NPRS | .895 .307| .955 .208 || CERT1 .1644 CERT1 | .275 .447| .422 .494 || CERT2 .2292 CERT2 | .490 .500| .467 .499 || MMORT -.5426 MMORT | .400 .490| .335 .472 || HMORT -1.2882 HMORT | .258 .438| .194 .396 || PRICE -.1973 PRICE | 8.561 3.497| 8.927 3.188 || ALT2 .6128 ONE | 1.000 .000| 1.000 .000 |+-------------------------------------------------------------------------++-------------------------------------------------------------------------+| Descriptive Statistics for Alternative NONE || Utility Function | (CBS wt = 1.00000) | 3951.0 observs. || Coefficient | All 9550.0 obs.|that chose NONE || Name Value Variable | Mean Std. Dev.|Mean Std. Dev. || ------------------- -------- | -------------------+------------------- || ASC -1.0213 ONE | 1.000 .000| 1.000 .000 |+-------------------------------------------------------------------------++---------------------------------------------------+| Elasticity averaged over observations.|| Effects on probabilities of all choices in model: || * = Direct Elasticity effect of the attribute. |+---------------------------------------------------+
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt CAGED in ALT1--------+-------------------------------------------------------------------- | Standard Prob. 95% Confidence Choice| Coefficient Error z |z|>Z* Interval--------+-------------------------------------------------------------------- ALT1| .01567*** .00110 14.30 .0000 .01353 .01782 ALT2| -.02306*** .00072 -32.20 .0000 -.02446 -.02166 NONE| .00750*** .00032 23.69 .0000 .00688 .00812--------+--------------------------------------------------------------------***, **, * ==> Significance at 1%, 5%, 10% level.Model was estimated on Nov 19, 2022 at 11:52:17 PM-----------------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt CAGED in ALT1--------+-------------------------------------------------------------------- | Average Sample Standard Sample Sample Choice| Elasticity Deviation Minimum Maximum--------+-------------------------------------------------------------------- ALT1| .01567 .00110 -1.048339 .97014 ALT2| -.02306 .00072 -.832149 .14075 NONE| .00750 .00032 -.125706 .12165--------+--------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt CAGED in ALT2--------+-------------------------------------------------------------------- | Standard Prob. 95% Confidence Choice| Coefficient Error z |z|>Z* Interval--------+-------------------------------------------------------------------- ALT1| -.01800*** .00085 -21.09 .0000 -.01967 -.01632 ALT2| -.00980*** .00120 -8.19 .0000 -.01215 -.00746 NONE| .01844*** .00052 35.46 .0000 .01742 .01945--------+--------------------------------------------------------------------***, **, * ==> Significance at 1%, 5%, 10% level.Model was estimated on Nov 19, 2022 at 11:52:17 PM-----------------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt CAGED in ALT2--------+-------------------------------------------------------------------- | Average Sample Standard Sample Sample Choice| Elasticity Deviation Minimum Maximum--------+-------------------------------------------------------------------- ALT1| -.01800 .00085 -.857762 .19395 ALT2| -.00980 .00120 -4.429265 .86448 NONE| .01844 .00052 -.114899 .31473--------+--------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt ACDOORS in ALT1--------+-------------------------------------------------------------------- | Standard Prob. 95% Confidence Choice| Coefficient Error z |z|>Z* Interval--------+-------------------------------------------------------------------- ALT1| .26345*** .00301 87.61 .0000 .25756 .26935 ALT2| -.08918*** .00255 -35.03 .0000 -.09417 -.08419 NONE| -.09644*** .00218 -44.26 .0000 -.10071 -.09217--------+--------------------------------------------------------------------***, **, * ==> Significance at 1%, 5%, 10% level.Model was estimated on Nov 19, 2022 at 11:52:17 PM-----------------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt ACDOORS in ALT1--------+-------------------------------------------------------------------- | Average Sample Standard Sample Sample Choice| Elasticity Deviation Minimum Maximum--------+-------------------------------------------------------------------- ALT1| .26345 .00301 .000000 1.29951 ALT2| -.08918 .00255 -2.410980 .00000 NONE| -.09644 .00218 -17.620707 .00000--------+--------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt ACDOORS in ALT2--------+-------------------------------------------------------------------- | Standard Prob. 95% Confidence Choice| Coefficient Error z |z|>Z* Interval--------+-------------------------------------------------------------------- ALT1| -.15766*** .00300 -52.55 .0000 -.16354 -.15178 ALT2| .30241*** .00326 92.66 .0000 .29601 .30881 NONE| -.12793*** .00245 -52.32 .0000 -.13272 -.12313--------+--------------------------------------------------------------------***, **, * ==> Significance at 1%, 5%, 10% level.Model was estimated on Nov 19, 2022 at 11:52:17 PM-----------------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt ACDOORS in ALT2--------+-------------------------------------------------------------------- | Average Sample Standard Sample Sample Choice| Elasticity Deviation Minimum Maximum--------+-------------------------------------------------------------------- ALT1| -.15766 .00300 -1.113150 .00015 ALT2| .30241 .00326 -8.577929 1.54070 NONE| -.12793 .00245 -.959014 .00007--------+--------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt PRICE in ALT1--------+-------------------------------------------------------------------- | Standard Prob. 95% Confidence Choice| Coefficient Error z |z|>Z* Interval--------+-------------------------------------------------------------------- ALT1| -.59836*** .00391 -152.92 .0000 -.60603 -.59070 ALT2| .16246*** .00161 101.17 .0000 .15932 .16561 NONE| .24892*** .00228 109.19 .0000 .24445 .25339--------+--------------------------------------------------------------------***, **, * ==> Significance at 1%, 5%, 10% level.Model was estimated on Nov 19, 2022 at 11:52:17 PM-----------------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt PRICE in ALT1--------+-------------------------------------------------------------------- | Average Sample Standard Sample Sample Choice| Elasticity Deviation Minimum Maximum--------+-------------------------------------------------------------------- ALT1| -.59836 .00391 -2.114475 .00000 ALT2| .16246 .00161 .013525 1.47958 NONE| .24892 .00228 .012178 1.47958--------+--------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt PRICE in ALT2--------+-------------------------------------------------------------------- | Standard Prob. 95% Confidence Choice| Coefficient Error z |z|>Z* Interval--------+-------------------------------------------------------------------- ALT1| .24151*** .00288 83.73 .0000 .23586 .24717 ALT2| -.54232*** .00336 -161.60 .0000 -.54889 -.53574 NONE| .25491*** .00254 100.44 .0000 .24993 .25988--------+--------------------------------------------------------------------***, **, * ==> Significance at 1%, 5%, 10% level.Model was estimated on Nov 19, 2022 at 11:52:17 PM-----------------------------------------------------------------------------
-----------------------------------------------------------------------------Average elasticity of prob(alt) wrt PRICE in ALT2--------+-------------------------------------------------------------------- | Average Sample Standard Sample Sample Choice| Elasticity Deviation Minimum Maximum--------+-------------------------------------------------------------------- ALT1| .24151 .00288 .000000 1.29952 ALT2| -.54232 .00336 -1.947200 -.13153 NONE| .25491 .00254 .000000 1.07492--------+--------------------------------------------------------------------
Elasticity wrt change of X in row choice on Prob[column choice]--------+--------------------------CAGED | ALT1 ALT2 NONE--------+-------------------------- ALT1| .0157 -.0231 .0075 ALT2| -.0180 -.0098 .0184
Elasticity wrt change of X in row choice on Prob[column choice]--------+--------------------------ACDOORS | ALT1 ALT2 NONE--------+-------------------------- ALT1| .2635 -.0892 -.0964 ALT2| -.1577 .3024 -.1279
Elasticity wrt change of X in row choice on Prob[column choice]--------+--------------------------PRICE | ALT1 ALT2 NONE--------+-------------------------- ALT1| -.5984 .1625 .2489 ALT2| .2415 -.5423 .2549
|-> ;RPL$Error 1: Unrecognized command. (Missing ; ?)
More information about the Limdep
mailing list