From Charles.Raux at laet.ish-lyon.cnrs.fr Wed May 10 00:46:18 2017 From: Charles.Raux at laet.ish-lyon.cnrs.fr (RAUX Charles) Date: Tue, 9 May 2017 14:46:18 +0000 Subject: [Limdep Nlogit List] variable types Message-ID: <72D6B3FEC474FA40B4981EDD2D672981ACE1ADA8@CNMB02WVP.core-res.rootcore.local> Hello, I am a newbie and trying to do basic things with data imported from a csv file. And I found nothing in various documentations (Limdep Reference guide, Econ. Model estimation and Nlogit guide). - How to reorder variables (for instance change the order of display in data editor)? - How to get information and deal with variable type? Categorical variables are mentioned but I see no means to transform a seemingly integer variable in a categorical variable. For instance importing "HealthData.csv" and trying |-> CREATE ; Expand(hlthsat) $ Error 711: Variable in EXPAND is not an integer from 1 to 100. Where can I see the type of "htlthsat" and how to change to integer (or categorical?) ? Regards Charles Raux From wgreene at stern.nyu.edu Wed May 10 01:32:33 2017 From: wgreene at stern.nyu.edu (William Greene) Date: Tue, 9 May 2017 11:32:33 -0400 Subject: [Limdep Nlogit List] variable types In-Reply-To: <72D6B3FEC474FA40B4981EDD2D672981ACE1ADA8@CNMB02WVP.core-res.rootcore.local> References: <72D6B3FEC474FA40B4981EDD2D672981ACE1ADA8@CNMB02WVP.core-res.rootcore.local> Message-ID: Dear Charles: The order in which variables appear in the data editor does not have any meaning in any context. For example, if you have variables x1, x2, x3, x4, the construction x1 - x4 does not have meaning. As such, there is means provided to reorder variables because the order already has no context. For the categorical variable, you have the right syntax. The problem is that the variable hlthsat has some miscoded noninteger values (between 6 and 7). If you use CREATE;NewHSAT=Int(hlthsat)$ you should be able to make the conversion. As for the type of variable, this information is not stored with the variable, but you can obtain it by using DSTAT;Rhs=the variable(s) ; Values $ This will give you some information about the variable, and show you what is wrong with HLTHSAT. (This is in Section E2.6.3 in the manual.) Regards William Greene On Tue, May 9, 2017 at 10:46 AM, RAUX Charles wrote: > Hello, > > I am a newbie and trying to do basic things with data imported from a csv > file. And I found nothing in various documentations (Limdep Reference > guide, Econ. Model estimation and Nlogit guide). > > - How to reorder variables (for instance change the order of display in > data editor)? > > - How to get information and deal with variable type? Categorical > variables are mentioned but I see no means to transform a seemingly integer > variable in a categorical variable. For instance importing "HealthData.csv" > and trying > > |-> CREATE ; Expand(hlthsat) $ > > Error 711: Variable in EXPAND is not an integer from 1 to 100. > > Where can I see the type of "htlthsat" and how to change to integer (or > categorical?) ? > > Regards > > Charles Raux > > > > _______________________________________________ > Limdep site list > Limdep at limdep.itls.usyd.edu.au > http://limdep.itls.usyd.edu.au > > -- William Greene Department of Economics Stern School of Business, New York University 44 West 4 St., 7-90 New York, NY, 10012 URL: http://people.stern.nyu.edu/wgreene Email: wgreene at stern.nyu.edu Ph. +1.212.998.0876 <(212)%20998-0876> Editor in Chief: Journal of Productivity Analysis Editor in Chief: Foundations and Trends in Econometrics Associate Editor: Economics Letters Associate Editor: Journal of Business and Economic Statistics Associate Editor: Journal of Choice Modeling From Charles.Raux at laet.ish-lyon.cnrs.fr Wed May 10 03:14:20 2017 From: Charles.Raux at laet.ish-lyon.cnrs.fr (RAUX Charles) Date: Tue, 9 May 2017 17:14:20 +0000 Subject: [Limdep Nlogit List] variable types In-Reply-To: References: <72D6B3FEC474FA40B4981EDD2D672981ACE1ADA8@CNMB02WVP.core-res.rootcore.local> Message-ID: <72D6B3FEC474FA40B4981EDD2D672981ACE1AE91@CNMB02WVP.core-res.rootcore.local> Thanks a lot for the quick answer and the tips. Charles > -----Message d'origine----- > De?: limdep-bounces at limdep.itls.usyd.edu.au [mailto:limdep- > bounces at limdep.itls.usyd.edu.au] De la part de William Greene > Envoy??: mardi 9 mai 2017 17:33 > ??: Limdep and Nlogit Mailing List > Objet?: Re: [Limdep Nlogit List] variable types > > Dear Charles: The order in which variables appear in the data editor > does not have any meaning in any context. For example, if you have > variables x1, x2, x3, x4, the construction x1 - x4 does not have > meaning. As such, there is means provided to reorder variables because > the order already has no context. For the categorical variable, you > have the right syntax. > The > problem is that the variable hlthsat has some miscoded noninteger > values (between 6 and 7). If you use CREATE;NewHSAT=Int(hlthsat)$ you > should be able to make the conversion. As for the type of variable, > this information is not stored with the variable, but you can obtain it > by using DSTAT;Rhs=the variable(s) ; Values $ This will give you some > information about the variable, and show you what is wrong with > HLTHSAT. (This is in Section E2.6.3 in the manual.) Regards William > Greene > > > On Tue, May 9, 2017 at 10:46 AM, RAUX Charles lyon. > cnrs.fr> wrote: > > > Hello, > > > > I am a newbie and trying to do basic things with data imported from a > > csv file. And I found nothing in various documentations (Limdep > > Reference guide, Econ. Model estimation and Nlogit guide). > > > > - How to reorder variables (for instance change the order of display > > in data editor)? > > > > - How to get information and deal with variable type? Categorical > > variables are mentioned but I see no means to transform a seemingly > > integer variable in a categorical variable. For instance importing > "HealthData.csv" > > and trying > > > > |-> CREATE ; Expand(hlthsat) $ > > > > Error 711: Variable in EXPAND is not an integer from 1 to 100. > > > > Where can I see the type of "htlthsat" and how to change to integer > > (or > > categorical?) ? > > > > Regards > > > > Charles Raux > > > > > > > > _______________________________________________ > > Limdep site list > > Limdep at limdep.itls.usyd.edu.au > > http://limdep.itls.usyd.edu.au > > > > > > > -- > William Greene > Department of Economics > Stern School of Business, New York University > 44 West 4 St., 7-90 > New York, NY, 10012 > URL: http://people.stern.nyu.edu/wgreene > Email: wgreene at stern.nyu.edu > Ph. +1.212.998.0876 <(212)%20998-0876> > Editor in Chief: Journal of Productivity Analysis Editor in Chief: > Foundations and Trends in Econometrics Associate Editor: Economics > Letters Associate Editor: Journal of Business and Economic Statistics > Associate Editor: Journal of Choice Modeling > _______________________________________________ > Limdep site list > Limdep at limdep.itls.usyd.edu.au > http://limdep.itls.usyd.edu.au From ambi.ganesh at gmail.com Thu May 11 17:12:22 2017 From: ambi.ganesh at gmail.com (Ganesh A R) Date: Thu, 11 May 2017 12:42:22 +0530 Subject: [Limdep Nlogit List] Regarding customized ordered probit models Message-ID: Hi all, I am not sure if this is a mail id for posting in forums kindly ignore this mail if this is not the right place to post I am trying to build a *customized ordered probit model*. I am having trouble building the probability and the log likelihood function A brief description about the data : 1. The dependent variable is ordinal in nature with 3 alternatives - 1, 2 & 3 2. a1,a2 and a3 are indicator dummy variables for each alternative 3. u1,u2 and u3 are utility functions 4. mu1 and mu2 are threshold values *for a constants only model, * MAXIMIZE;Labels = b2,b3,mu1,mu2 ;Start = 0,0,0,0 ;Fcn = u1 = 0| u2 = b2 | u3 = b3 | p1 = 1 - phi(u1-mu1) | p2 = phi(u2-mu1) - phi(u2-mu2) | p3 = phi(u3-mu2) | llkhd = (a1*log(p1) + a2*log(p2) + a3*log(p3)) | llkhd$ The model gives me error. I can understand that one reason might be because I have not told the function that the ordinal variable values are 1, 2 and 3. I would like to know what mistakes have I done in the above likelihood function and how to rectify it. Thanking you Yours Sincerely Ganesh ?PhD student IIT Madras ? From wgreene at stern.nyu.edu Thu May 11 22:34:56 2017 From: wgreene at stern.nyu.edu (William Greene) Date: Thu, 11 May 2017 08:34:56 -0400 Subject: [Limdep Nlogit List] Regarding customized ordered probit models In-Reply-To: References: Message-ID: Ganesh. You have not forced the probabilities to sum to one. Also, at the starting values, p2 = 0, so the log of p2 cannot be computed. /Bill Greene On Thu, May 11, 2017 at 3:12 AM, Ganesh A R wrote: > Hi all, > > I am not sure if this is a mail id for posting in forums kindly ignore this > mail if this is not the right place to post > > > I am trying to build a *customized ordered probit model*. I am having > trouble building the probability and the log likelihood function > > A brief description about the data : > 1. The dependent variable is ordinal in nature with 3 alternatives - 1, 2 & > 3 > 2. a1,a2 and a3 are indicator dummy variables for each alternative > 3. u1,u2 and u3 are utility functions > 4. mu1 and mu2 are threshold values > > *for a constants only model, * > > MAXIMIZE;Labels = b2,b3,mu1,mu2 > ;Start = 0,0,0,0 > ;Fcn = u1 = 0| > u2 = b2 | > u3 = b3 | > p1 = 1 - phi(u1-mu1) | > p2 = phi(u2-mu1) - phi(u2-mu2) | > p3 = phi(u3-mu2) | > llkhd = (a1*log(p1) + a2*log(p2) + a3*log(p3)) | > llkhd$ > > > The model gives me error. I can understand that one reason might be because > I have not told the function that the ordinal variable values are 1, 2 and > 3. > I would like to know what mistakes have I done in the above likelihood > function and how to rectify it. > > Thanking you > > Yours Sincerely > > Ganesh > > ?PhD student > > IIT Madras > > ? > _______________________________________________ > Limdep site list > Limdep at limdep.itls.usyd.edu.au > http://limdep.itls.usyd.edu.au -- William Greene Department of Economics Stern School of Business, New York University 44 West 4 St., 7-90 New York, NY, 10012 URL: http://people.stern.nyu.edu/wgreene Email: wgreene at stern.nyu.edu Ph. +1.212.998.0876 Editor in Chief: Journal of Productivity Analysis Editor in Chief: Foundations and Trends in Econometrics Associate Editor: Economics Letters Associate Editor: Journal of Business and Economic Statistics Associate Editor: Journal of Choice Modeling From sra3939 at ksu.edu Sun May 14 08:36:02 2017 From: sra3939 at ksu.edu (Steven Ramsey) Date: Sat, 13 May 2017 22:36:02 +0000 Subject: [Limdep Nlogit List] MLOGIT RPM Error 697 Message-ID: Wondering if anyone can help me out. I'm running the code below: MLOGIT ;LHS = LU_T ;RHS = ONE,CLAY,SILT,TFACTOR,WEI,PSOY,PCORN,PWHEAT,PDIESEL,PLABOR, AVGM31,AVGM32,AVGM33,AVGM34,AVGS31,AVGS32,AVGS33,AVGS34, PRECSUM,PRECFALL, OTH0,SORG0,WHEAT0,FALLOW0, OTH00,SORG00,WHEAT00,FALLOW00, OTHTM1,SORGTM1,WHEATTM1,FALLTM1, OTHTM2,SORGTM2,WHEATTM2,FALLTM2, MPSOY,MPCORN,MPWHEAT, MAVGM31,MAVGM32,MAVGM33,MAVGM34,MAVGSD31, MAVGSD32,MAVGSD33,MAVGSD34, MPRECSUM,MPREFALL ;ALG = DFP ;MAXIT = 10000 ;TLF = 1E-20 ;TLG = 0.5E-4 ;OUTPUT = 1 $ MLOGIT ;LHS = LU_T ;RHS = ONE,CLAY,SILT,TFACTOR,WEI,PSOY,PCORN,PWHEAT,PDIESEL,PLABOR, AVGM31,AVGM32,AVGM33,AVGM34,AVGS31,AVGS32,AVGS33,AVGS34, PRECSUM,PRECFALL, OTH0,SORG0,WHEAT0,FALLOW0, OTH00,SORG00,WHEAT00,FALLOW00, OTHTM1,SORGTM1,WHEATTM1,FALLTM1, OTHTM2,SORGTM2,WHEATTM2,FALLTM2, MPSOY,MPCORN,MPWHEAT, MAVGM31,MAVGM32,MAVGM33,MAVGM34,MAVGSD31, MAVGSD32,MAVGSD33,MAVGSD34, MPRECSUM,MPREFALL ;RPM ;FCN=ONE(N) ;HALTON ;PTS = 20 ;PDS = 8 ;ALG = DFP ;MAXIT = 10000 ;TLF = 1E-20 ;TLG = 0.5E-4 ;OUTPUT = 1 $ The first model estimates, but I continually get "Error 697: Expected to find B matrix from previous LOGIT model." Based on the documentation, it doesn't appear I need to manually keep the matrix with MATRIX; something = B, and then use this as a starting point. But, I have tried that, and it also didn't work. Any thoughts would be appreciated. Thanks, Steve Ramsey From mariapapadim at windowslive.com Thu May 18 18:28:37 2017 From: mariapapadim at windowslive.com (Maria Papadimitriou) Date: Thu, 18 May 2017 08:28:37 +0000 Subject: [Limdep Nlogit List] TRE AND GTRE with Mundlak adjustment Message-ID: Dear Professor, I am trying to run TRE and GTRE models with Mundlak adjustment. So I am using the commands below CREATE; PGAGG_M = Group Mean (LPGS,Str=ID) $ CREATE; UGMED_M = Group Mean (LUGMED,Str=ID) $ CREATE; UGSC_M = Group Mean (LUGSCIE,Str=ID) $ CREATE; UGART_M = Group Mean (LUGSART,Str=ID) $ CREATE; RESR_M = Group Mean (LRESEAR,Str=ID) $ NAMELIST;Mundlak=one,PGAGG_M,UGMED_M,UGSC_M,UGART_M,RESR_M,LPGS,LUGMED,LUGSCIE,LUGSART,LRESEAR,OXBRIDGE,LONDON,TIME$ TRE FRONTIER ;Cost; LHS =Inputs ; RHS=Mundlak $ FRONTIER ;Cost; LHS =Inputs ; RHS=Mundlak ; Panel; RPM ; FCN = One(N);HALTON ;PTS = 5000;COSTEFF = UITREM $ GTRE FRONTIER ;Cost; LHS =Inputs ; RHS=Mundlak $ FRONTIER;COST;Lhs=Inputs;Rhs=Mundlak;Panel;CSN;Halton;Pts=5000;OUTPUT=3;Keep$ My question regards the time invariant- dummy variables (TIME,OXBRIDGE,LONDON) Should I compute only the panel-level average of the time-varying covariates? And then incorporate the dummies? So my main concern is whether I have properly constructed the mundlak specification or not. Thank you in advance! Best wishes, Maria Ms Maria Papadimitriou Graduate Teaching Assistant in Economics PhD Candidate in Economics Lancaster University Charles Carter Building, floor D, Lancaster United Kingdom | T: +44 (0)7597745806 | Web page: http://www.lancs.ac.uk/lums/people/all/maria-papadimitriou/| E-mail address m.papadimitriou at lancaster.ac.uk Call Send SMS Add to Skype You'll need Skype CreditFree via Skype From melanie.velarde at uni-osnabrueck.de Sat May 20 00:33:43 2017 From: melanie.velarde at uni-osnabrueck.de (Melanie Velarde) Date: Fri, 19 May 2017 14:33:43 +0000 Subject: [Limdep Nlogit List] Multinomial Multiperiod Probit Model Message-ID: <9cfaead78b3847c1be16c19a2ae31602@fb9exmb2.fb9.uni-osnabrueck.de> Hello everyone, I'm using Nlogit for the very first time and I'm trying to estimate a multiperiod multinomial probit model on the basis of an unbalanced panel (household survey). To keep things simple, I started with the following specification (fyi I'm not working with any choice specific attributes) MNPROBIT ;Lhs = CHOICE ;Choices = A, B, C ;Model: U(B)= BALPHA + BDCE*DCE / U(C)= CALPHA + CDCE*DCE $ and Nlogit started to "work" without any complaints. However, as soon as I add ;Pds = NWAVES to take account of the fact that I'm using an unbalanced panel, I get the following error message Error 1097: Unusable LHS variable in choice model setup I've read all the information about preparing and working with panel data, which is available in all three guides provided when purchasing Nlogit. I particularly made sure that my variable NWAVES reflects not the number of rows per household (I have 3 rows per survey wave and household, because of the 3 identical choices available every wave), but rather the total number of waves that a household was surveyed. I have no clue what I'm doing wrong! Any ideas? Thanks a lot in advance for any suggestions!!! Best regards, Melanie Velarde Wissenschaftliche Mitarbeiterin Fachgebiet ?konometrie und Statistik Fachbereich Wirtschaftswissenschaften Universit?t Osnabr?ck Rolandstr. 8 49069 Osnabr?ck Tel.: + 49 541 9692756 E-Mail: melanie.velarde at uni-osnabrueck.de From Jane.Kolodinsky at uvm.edu Sat May 20 00:39:22 2017 From: Jane.Kolodinsky at uvm.edu (Jane Kolodinsky) Date: Fri, 19 May 2017 14:39:22 +0000 Subject: [Limdep Nlogit List] Multinomial Multiperiod Probit Model In-Reply-To: <9cfaead78b3847c1be16c19a2ae31602@fb9exmb2.fb9.uni-osnabrueck.de> References: <9cfaead78b3847c1be16c19a2ae31602@fb9exmb2.fb9.uni-osnabrueck.de> Message-ID: <2fa2b75a44444acd96b0b36998357fd7@uvm.edu> I would be very interested in the answer to this! -----Original Message----- From: limdep-bounces at limdep.itls.usyd.edu.au [mailto:limdep-bounces at limdep.itls.usyd.edu.au] On Behalf Of Melanie Velarde Sent: Friday, May 19, 2017 10:34 AM To: limdep at limdep.itls.usyd.edu.au Cc: Melanie Velarde Subject: [Limdep Nlogit List] Multinomial Multiperiod Probit Model Hello everyone, I'm using Nlogit for the very first time and I'm trying to estimate a multiperiod multinomial probit model on the basis of an unbalanced panel (household survey). To keep things simple, I started with the following specification (fyi I'm not working with any choice specific attributes) MNPROBIT ;Lhs = CHOICE ;Choices = A, B, C ;Model: U(B)= BALPHA + BDCE*DCE / U(C)= CALPHA + CDCE*DCE $ and Nlogit started to "work" without any complaints. However, as soon as I add ;Pds = NWAVES to take account of the fact that I'm using an unbalanced panel, I get the following error message Error 1097: Unusable LHS variable in choice model setup I've read all the information about preparing and working with panel data, which is available in all three guides provided when purchasing Nlogit. I particularly made sure that my variable NWAVES reflects not the number of rows per household (I have 3 rows per survey wave and household, because of the 3 identical choices available every wave), but rather the total number of waves that a household was surveyed. I have no clue what I'm doing wrong! Any ideas? Thanks a lot in advance for any suggestions!!! Best regards, Melanie Velarde Wissenschaftliche Mitarbeiterin Fachgebiet ?konometrie und Statistik Fachbereich Wirtschaftswissenschaften Universit?t Osnabr?ck Rolandstr. 8 49069 Osnabr?ck Tel.: + 49 541 9692756 E-Mail: melanie.velarde at uni-osnabrueck.de _______________________________________________ Limdep site list Limdep at limdep.itls.usyd.edu.au http://limdep.itls.usyd.edu.au From wgreene at stern.nyu.edu Mon May 22 02:49:16 2017 From: wgreene at stern.nyu.edu (William Greene) Date: Sun, 21 May 2017 12:49:16 -0400 Subject: [Limdep Nlogit List] Multinomial Multiperiod Probit Model In-Reply-To: <9cfaead78b3847c1be16c19a2ae31602@fb9exmb2.fb9.uni-osnabrueck.de> References: <9cfaead78b3847c1be16c19a2ae31602@fb9exmb2.fb9.uni-osnabrueck.de> Message-ID: Melanie. NWAVES should give the number of choice situations per household, not the number of rows of data. If you have 3 choices in every choice situation and 4 choice situations for each household, NWAVES would equal 4, not 12, as you noted. With varying numbers of choice situations, nwaves is going to take that value for each row for each household. For the households with 4 waves, NWAVES will equal 4 for the 12 rows. If the household was observed 5 times, NWAVES would equal 5 for 15 rows. That said, I doubt the multinomial probit will work well with varying numbers of choice situations per household, because the full covariance matrix, which is NWAVES*3 by NVAVES*3 is being estimated, so when this has varying dimensions, the log likelihood is going to become ambiguous to compute. It will work fine for mixed logit models and LC models. But, for the MNP model, the covariance matrix is a fixed entity with fixed dimensions. You might make some initial progress by selecting (for purpose of getting started) households that all have the same number of waves. For more general purposes, I suspect the mixed logit, or the error components logit model will work out better. Regards Bill Greene On Fri, May 19, 2017 at 10:33 AM, Melanie Velarde < melanie.velarde at uni-osnabrueck.de> wrote: > Hello everyone, > > I'm using Nlogit for the very first time and I'm trying to estimate a > multiperiod multinomial probit model on the basis of an unbalanced panel > (household survey). > To keep things simple, I started with the following specification (fyi I'm > not working with any choice specific attributes) > > MNPROBIT > ;Lhs = CHOICE > ;Choices = A, B, C > ;Model: > U(B)= BALPHA + BDCE*DCE / > U(C)= CALPHA + CDCE*DCE $ > > and Nlogit started to "work" without any complaints. However, as soon as I > add > > ;Pds = NWAVES > > to take account of the fact that I'm using an unbalanced panel, I get the > following error message > > Error 1097: Unusable LHS variable in choice model setup > > > I've read all the information about preparing and working with panel data, > which is available in all three guides provided when purchasing Nlogit. > I particularly made sure that my variable NWAVES reflects not the number > of rows per household (I have 3 rows per survey wave and household, because > of the 3 identical choices available every wave), but rather the total > number of waves that a household was surveyed. > > I have no clue what I'm doing wrong! Any ideas? > > Thanks a lot in advance for any suggestions!!! > > > Best regards, > > Melanie Velarde > > Wissenschaftliche Mitarbeiterin > Fachgebiet ?konometrie und Statistik > Fachbereich Wirtschaftswissenschaften > Universit?t Osnabr?ck > Rolandstr. 8 > 49069 Osnabr?ck > Tel.: + 49 541 9692756 > E-Mail: melanie.velarde at uni-osnabrueck.de velarde at uni-osnabrueck.de> > > _______________________________________________ > Limdep site list > Limdep at limdep.itls.usyd.edu.au > http://limdep.itls.usyd.edu.au > > -- William Greene Department of Economics Stern School of Business, New York University 44 West 4 St., 7-90 New York, NY, 10012 URL: http://people.stern.nyu.edu/wgreene Email: wgreene at stern.nyu.edu Ph. +1.212.998.0876 Editor in Chief: Journal of Productivity Analysis Editor in Chief: Foundations and Trends in Econometrics Associate Editor: Economics Letters Associate Editor: Journal of Business and Economic Statistics Associate Editor: Journal of Choice Modeling