Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Nils Wlömert <nils.wloemert@gmx.net> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: xi3 / nlogit |

Date |
Sat, 4 Dec 2010 17:58:21 +0100 |

Attributes p_ppd (price I) -0,4507 p_fl (price II) -0,8754 p_drm -0,1731 fl_drm -0,5922 ad -0,2764 cat 0,2817 nobuy -1,6554

. xi3 e.p_drm e.fl_drm e.ad e.cat e.nobuy

e.ad _Iad_0-4 (naturally coded; _Iad_0 omitted) e.cat _Icat_0-4 (naturally coded; _Icat_0 omitted)

note: _Icat_4 dropped because of collinearity note: _Iad_4 dropped because of collinearity note: model has collinear variables; convergence may not be achieved

Attributes: p_ppd (price I - linear) -0,3540 p_fl (price II - linear) -1,1689 p_drm (effect) 1 0,4179 2 -0,2083 3 0,2317 4 -0,4412 fl_drm (effect) 1 0,5906 2 0,3027 3 -0,2918 4 -0,6015 ad (effect) 1 0,4328 2 0,1001 3 -0,0839 4 -0,4489 cat (effect) 1 -0,5570 2 -0,0606 3 0,2858 4 0,3318 nobuy (effect) 0 0,4390 1 -0,4390 The same thing happens using nlogit:

note: _Iad_2 dropped because of collinearity note: _Icat_2 dropped because of collinearity

Thanks & best, Nils Am 04.12.2010 um 01:31 schrieb Michael Mitchell:

Dear Nils When I wrote -xi3-, I don't think these models existed (or if they did, I did not have them in mind). So, unfortunately, -xi3- does not immediately work with programs like -xtmixed-, or -nlogit-, because it gets confused by the pipes -||-. However, you can still use -xi3- if you do it in a two step process. For example, here is using -xi3- in a one step process to do a regression . sysuse auto (1978 Automobile Data) . xi3: regress price e.rep78 g.foreigne.rep78 _Irep78_1-5 (naturally coded; _Irep78_1omitted)g.foreign _Iforeign_0-1 (naturally coded; _Iforeign_0omitted)Source | SS df MS Number of obs= 69-------------+------------------------------ F( 5, 63)= 0.19Model | 8372481.37 5 1674496.27 Prob > F= 0.9670Residual | 568424478 63 9022610.75 R-squared= 0.0145-------------+------------------------------ Adj R-squared= -0.0637Total | 576796959 68 8482308.22 Root MSE= 3003.8------------------------------------------------------------------------------price | Coef. Std. Err. t P>|t| [95% Conf.Interval]-------------+----------------------------------------------------------------_Irep78_2 | 188.879 1024.352 0.18 0.854 -1858.1242235.882_Irep78_3 | 646.8116 710.873 0.91 0.366 -773.75482067.378_Irep78_4 | 274.3754 799.3802 0.34 0.733 -1323.0591871.809_Irep78_5 | 104.1799 1036.513 0.10 0.920 -1967.1262175.486_Iforeign_1 | 36.7572 1010.484 0.04 0.971 -1982.5332056.048_cons | 5797.125 581.597 9.97 0.000 4634.8966959.353------------------------------------------------------------------------------ Instead, we can first use -xi3- to create the coded variables.... . xi3 e.rep78 g.foreigne.rep78 _Irep78_1-5 (naturally coded; _Irep78_1omitted)g.foreign _Iforeign_0-1 (naturally coded; _Iforeign_0omitted)And then we can include the coded variables into the model, as shownbelow.. regress price _Irep78_2 _Irep78_3 _Irep78_4 _Irep78_5 _Iforeign_1Source | SS df MS Number of obs= 69-------------+------------------------------ F( 5, 63)= 0.19Model | 8372481.37 5 1674496.27 Prob > F= 0.9670Residual | 568424478 63 9022610.75 R-squared= 0.0145-------------+------------------------------ Adj R-squared= -0.0637Total | 576796959 68 8482308.22 Root MSE= 3003.8------------------------------------------------------------------------------price | Coef. Std. Err. t P>|t| [95% Conf.Interval]-------------+----------------------------------------------------------------_Irep78_2 | 188.879 1024.352 0.18 0.854 -1858.1242235.882_Irep78_3 | 646.8116 710.873 0.91 0.366 -773.75482067.378_Irep78_4 | 274.3754 799.3802 0.34 0.733 -1323.0591871.809_Irep78_5 | 104.1799 1036.513 0.10 0.920 -1967.1262175.486_Iforeign_1 | 36.7572 1010.484 0.04 0.971 -1982.5332056.048_cons | 5797.125 581.597 9.97 0.000 4634.8966959.353------------------------------------------------------------------------------ I know it is a kludge, but I hope it works for you. Best regards, Michael N. Mitchell Data Management Using Stata - http://www.stata.com/bookstore/dmus.html A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.htmlStata tidbit of the week - http://www.MichaelNormanMitchell.comOn Fri, Dec 3, 2010 at 4:07 PM, Nils Wlömert <nils.wloemert@gmx.net>wrote:Dear listers, I would like to use effect-coding (via xi3) with nlogit:xi3: nlogit decision p_ppd p_fl e.p_drm e.fl_drm e.ad e.cat e.nobuy|| type:|| alternative:, noconst case(case_1) However, I get the following error: "|" invalid name r(198); Does xi3 work with nested models at all? Estimation works fine without effect-coding via xi3. Many thanks! Nils * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: xi3 / nlogit***From:*"Michael N. Mitchell" <Michael.Norman.Mitchell@gmail.com>

**References**:**st: xi3 / nlogit***From:*Nils Wlömert <nils.wloemert@gmx.net>

**Re: st: xi3 / nlogit***From:*Michael Mitchell <Michael.Norman.Mitchell@gmail.com>

- Prev by Date:
**[no subject]** - Next by Date:
**Re: st: summing across observations for given id and date** - Previous by thread:
**Re: st: xi3 / nlogit** - Next by thread:
**Re: st: xi3 / nlogit** - Index(es):