From juho.valtiala at luke.fi Wed Aug 18 16:40:23 2021 From: juho.valtiala at luke.fi (Valtiala Juho (Luke)) Date: Wed, 18 Aug 2021 06:40:23 +0000 Subject: [Limdep Nlogit List] Why estimates remain unaffected when using ordinary weights in rank-ordered logistic regression? Message-ID: Dear list members, I am using rank-ordered logit to analyse the data from a questionnaire in which people were asked to rank their preferences. Farmers are over-represented among the respondents, and I would like to give less weight to farmers' responses. I am using the following NLOGIT command: DISCRETECHOICE; Lhs=RANK; Choices=1,2,3,4,5; Ranks; Conditional; Rh2=ONE,HIGH_EDUC$ My problem is that when I apply ordinary weights by adding Wts=FWEIGHT argument the results remain unaffected. NLOGIT executes the command normally and the weight variable FWEIGHT is shown in output as expected. So, why the weight has no effect on estimates? Is there a problem with the command or is the problem a theoretic one which I have not considered? The weighting variable has effect when I use ordinary multinomial logit with the preferred alternative instead of ranked alternatives. Best regards, Juho Valtiala From alessandro.corsi at unito.it Thu Aug 19 20:41:34 2021 From: alessandro.corsi at unito.it (Alessandro Corsi) Date: Thu, 19 Aug 2021 12:41:34 +0200 Subject: [Limdep Nlogit List] Problem with NLCONVERT Message-ID: <71e438f9-1d48-9a32-2765-7adea33d7611@unito.it> I'm trying to convert a OneLine Data Set to a Nlogit format, using NLCONVERT. My original Data Set has 3 dummy variables of the choices (vino, uva, coop) from which I create a choice variable with 3 values, after which I try to use the NLCONVERT command: Create; if (vino=1) choicei =1; if (uva=1)? choicei =2; if (coop=1) choicei =3 $ NLCONVERT; Lhs = choicei ; Choices = vino1, uva1, coop1 ; Rhs = PR_M_V,PR_M_U, PR_M_C ; Rh2 = vite, vite_sau, AGRITUR, BIO, COMPUTER, SITO_WEB, ETA, SEX, ANNISTUD, AGR_STUD, PT_MAGG, PT_MIN, STRANIER, LAV_INT, NMEMBR, N0_5, N6_13 ; Names = choice1,prezzo, vite1, vite_sa1, AGRITUR1, BIO1, COMPUTR1, SIT_WEB1, ETA1, SEX1, ANNSTUD1, AGR_STU1, PT_MAGG1, PT_MIN1, STRANER1, LAV_INT1, NMEMBR1, N0_5_1, N6_13_1 $ I receive the following error message: Error?? 1020: Names=List gave? 3 names. Needed #lhs+? 1+#Rh2= 19 Can anybody suggest what causes the problem? Many thanks Alessandro Corsi -- Questa e-mail ? stata controllata per individuare virus con Avast antivirus. https://protect-au.mimecast.com/s/GoihC6XQ4LfrD9PZZtpicph?domain=avast.com From wgreene at stern.nyu.edu Mon Aug 23 04:43:30 2021 From: wgreene at stern.nyu.edu (William Greene) Date: Sun, 22 Aug 2021 14:43:30 -0400 Subject: [Limdep Nlogit List] Problem with NLCONVERT In-Reply-To: <71e438f9-1d48-9a32-2765-7adea33d7611@unito.it> References: <71e438f9-1d48-9a32-2765-7adea33d7611@unito.it> Message-ID: Alessandro: I assume you are using NLOGIT 6. Superficially, the command looks correct. I suggest you try the following: Use the command CLIST ; Convert = choice1,prezzo, vite1, vite_sa1, AGRITUR1, BIO1, COMPUTR1, SIT_WEB1,ETA1, SEX1, ANNSTUD1, AGR_STU1, PT_MAGG1, PT_MIN1, STRANER1, LAV_INT1, NMEMBR1, N0_5_1, N6_13_1 $ to create a labeled list that contains the 19 names. Then, change the ;Names=... part of your command to ;Names = Convert $ /Bill Greene On Thu, Aug 19, 2021 at 6:41 AM Alessandro Corsi wrote: > I'm trying to convert a OneLine Data Set to a Nlogit format, using > NLCONVERT. > > My original Data Set has 3 dummy variables of the choices (vino, uva, > coop) from which I create a choice variable with 3 values, after which I > try to use the NLCONVERT command: > > Create; > if (vino=1) choicei =1; > if (uva=1) choicei =2; > if (coop=1) choicei =3 $ > > NLCONVERT; Lhs = choicei > ; Choices = vino1, uva1, coop1 > ; Rhs = PR_M_V,PR_M_U, PR_M_C > ; Rh2 = vite, vite_sau, AGRITUR, BIO, COMPUTER, SITO_WEB, > ETA, SEX, ANNISTUD, AGR_STUD, PT_MAGG, PT_MIN, STRANIER, > LAV_INT, NMEMBR, N0_5, N6_13 > ; Names = choice1,prezzo, > vite1, vite_sa1, AGRITUR1, BIO1, COMPUTR1, SIT_WEB1, > ETA1, SEX1, ANNSTUD1, AGR_STU1, PT_MAGG1, PT_MIN1, STRANER1, > LAV_INT1, NMEMBR1, N0_5_1, N6_13_1 $ > > I receive the following error message: > > Error 1020: Names=List gave 3 names. Needed #lhs+ 1+#Rh2= 19 > > Can anybody suggest what causes the problem? > > Many thanks > > Alessandro Corsi > > > -- > Questa e-mail ? stata controllata per individuare virus con Avast > antivirus. > https://protect-au.mimecast.com/s/AvQpCP7LAXfKOr1NkszgKkc?domain=avast.com > > _______________________________________________ > Limdep site list > Limdep at mailman.sydney.edu.au > https://protect-au.mimecast.com/s/GcX9CQnMBZfk8E1lyFP2uGJ?domain=limdep.itls.usyd.edu.au > > -- William Greene Department of Economics, emeritus Stern School of Business, New York University 44 West 4 St. New York, NY, 10012 URL: https://protect-au.mimecast.com/s/KBHUCROND2uvJkD0zsPFeoD?domain=people.stern.nyu.edu Email: wgreene at stern.nyu.edu 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 From wgreene at stern.nyu.edu Mon Aug 23 23:28:29 2021 From: wgreene at stern.nyu.edu (William Greene) Date: Mon, 23 Aug 2021 09:28:29 -0400 Subject: [Limdep Nlogit List] Why estimates remain unaffected when using ordinary weights in rank-ordered logistic regression? In-Reply-To: References: Message-ID: Juho. (1) ;Conditional is used for the nested logit model, but the nested logit model does not support ranks. (2) when fitting a clogit model with rank data, each observation generates J-1 terms in the log likelihood, not one term. As such, it is not clear how to treat weights. It is also unclear how much information, if any, is provided by ranks beyond the most preferred. For these reasons, nlogit does not attempt to treat a weighting variable when ranked data are provided. Regards Bill Greene On Wed, Aug 18, 2021 at 2:57 AM Valtiala Juho (Luke) wrote: > Dear list members, > I am using rank-ordered logit to analyse the data from a questionnaire in > which people were asked to rank their preferences. Farmers are > over-represented among the respondents, and I would like to give less > weight to farmers' responses. I am using the following NLOGIT command: > > DISCRETECHOICE; Lhs=RANK; Choices=1,2,3,4,5; Ranks; Conditional; > Rh2=ONE,HIGH_EDUC$ > > My problem is that when I apply ordinary weights by adding Wts=FWEIGHT > argument the results remain unaffected. NLOGIT executes the command > normally and the weight variable FWEIGHT is shown in output as expected. > So, why the weight has no effect on estimates? Is there a problem with the > command or is the problem a theoretic one which I have not considered? The > weighting variable has effect when I use ordinary multinomial logit with > the preferred alternative instead of ranked alternatives. > > Best regards, > Juho Valtiala > > _______________________________________________ > Limdep site list > Limdep at mailman.sydney.edu.au > https://protect-au.mimecast.com/s/l3KLC2xMQzipv8nnYinn_ak?domain=limdep.itls.usyd.edu.au > > -- William Greene Department of Economics, emeritus Stern School of Business, New York University 44 West 4 St. New York, NY, 10012 URL: https://protect-au.mimecast.com/s/RdkcC3QNPBipw2LLkiqgDkq?domain=people.stern.nyu.edu Email: wgreene at stern.nyu.edu 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 From iris.vanermen at kuleuven.be Mon Aug 23 23:30:07 2021 From: iris.vanermen at kuleuven.be (Iris Vanermen) Date: Mon, 23 Aug 2021 13:30:07 +0000 Subject: [Limdep Nlogit List] Pds specification for choice modeling with unbalanced datasets In-Reply-To: References: <0b35a8c3d86e4f5f944d9523e6d77d04@ICTS-S-EXMBX17.luna.kuleuven.be> Message-ID: <96d781c8456d45f988a977ce0929c492@ICTS-S-EXMBX17.luna.kuleuven.be> Many thanks for your reply. The issue was resolved! -----Original Message----- From: Limdep On Behalf Of William Greene via Limdep Sent: woensdag 28 juli 2021 1:10 To: Limdep and Nlogit Mailing List Cc: William Greene Subject: Re: [Limdep Nlogit List] Pds specification for choice modeling with unbalanced datasets Iris. The unbalanced choice model has a complicated data set. Observations (rows of data) are grouped within a choice task, and there is a panel of choice tasks. NLOGIT handles this case by borrowing part of the process from the ordinary panel data routine. The match of the data to the specification ends up being checked twice, once as if it were an ordinary panel and a second time by the RPLogit routine. (There is a description in Section N29.10 in the manual how this is set up - you would have used the guide there to set up the data.) The diagnostic you received is generated by the first pass through the data. But, this can be ignored. It is the second pass that actually tallies the panel setup for RPLogit. So, if your data are arranged as the estimator expects, you can ignore that diagnostic. (It should be a warning, not an error.) Regards, Bill Greene On Tue, Jul 27, 2021 at 6:25 PM Iris Vanermen wrote: > Dear Mr., Ms., > > I am trying to estimate a random parameters logit model in which the > number of choice tasks differs between individuals. For this, I am > trying to adjust the Pds specification with a variable indicating the > number of choice cards per individual but I get following error: "Error 1081: > Mismatch of # indivs. and number implied by groups" that I do not seem > to be able to resolve. How should I specify Pds in case of different > number of choice cards per individual? > > Many thanks! > Best regards, > Iris Vanermen > _______________________________________________ > Limdep site list > Limdep at mailman.sydney.edu.au > https://protect-au.mimecast.com/s/I6KKCYW8NocLQAGw0T0j7I9?domain=limdep.itls.usyd.edu.au > > -- William Greene Department of Economics, emeritus Stern School of Business, New York University 44 West 4 St. New York, NY, 10012 URL: https://protect-au.mimecast.com/s/8tbeCZY1Nqi5EQO0mijfutY?domain=people.stern.nyu.edu Email: wgreene at stern.nyu.edu 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 _______________________________________________ Limdep site list Limdep at mailman.sydney.edu.au https://protect-au.mimecast.com/s/I6KKCYW8NocLQAGw0T0j7I9?domain=limdep.itls.usyd.edu.au From iris.vanermen at kuleuven.be Mon Aug 23 23:33:25 2021 From: iris.vanermen at kuleuven.be (Iris Vanermen) Date: Mon, 23 Aug 2021 13:33:25 +0000 Subject: [Limdep Nlogit List] Nlogit shuts down Message-ID: <69f9f8e4b2774827bd88a8d00a55a34b@ICTS-S-EXMBX17.luna.kuleuven.be> Dear community members, I am analyzing a discrete choice experiment and am trying to simultaneously estimate certainty and preferences following the approach of Rose, Beck & Hensher, 2015 ("The joint estimation of respondent-reported certainty and acceptability with choice"), using the code below. This works perfectly fine but when I try to include WTP calculations, Nlogit 5 shuts down (I don't get an error message). My sample contains 143 individuals that each received 6 choice cards with 3 alternatives (2 + opt-out). Without WTP: RPLOGIT ;lhs = choice ;Choices = 1, 2, OO ;Halton ;pts = 1000 ;pds = 6 ;FCN = bBD_Muc(n), bBD_Huc(n), bW_Muc(n), bW_Huc(n), bER_Muc(n), bER_Huc(n), bC_Muc(n), bC_Huc(n), bBD_Mc(n), bBD_Hc(n), bW_Mc(n), bW_Hc(n), bER_Mc(n), bER_Hc(n), bC_Mc(n), bC_Hc(n) ;Parameters ;Model: U(1,2) = bBD_Muc * BD_Muc + bBD_Huc * BD_Huc + bW_Muc * W_Muc + bW_Huc * W_Huc + bER_Muc * ER_Muc + bER_Huc * ER_Huc + bC_Muc * C_Muc + bC_Huc * C_Huc + bPuc * price_uc + bBD_Mc * BD_Mc + bBD_Hc * BD_Hc + bW_Mc * W_Mc + bW_Hc * W_Hc + bER_Mc * ER_Mc + bER_Hc * ER_Hc + bC_Mc * C_Mc + bC_Hc * C_Hc + bPc * price_c/ U(OO) = OO $ With WTP: RPLOGIT ;lhs = choice ;Choices = 1, 2, OO ;Halton ;pts = 1000 ;pds = 6 ;FCN = bBD_Muc(n), bBD_Huc(n), bW_Muc(n), bW_Huc(n), bER_Muc(n), bER_Huc(n), bC_Muc(n), bC_Huc(n), bBD_Mc(n), bBD_Hc(n), bW_Mc(n), bW_Hc(n), bER_Mc(n), bER_Hc(n), bC_Mc(n), bC_Hc(n) ;Parameters ;Model: U(1,2) = bBD_Muc * BD_Muc + bBD_Huc * BD_Huc + bW_Muc * W_Muc + bW_Huc * W_Huc + bER_Muc * ER_Muc + bER_Huc * ER_Huc + bC_Muc * C_Muc + bC_Huc * C_Huc + bPuc * price_uc + bBD_Mc * BD_Mc + bBD_Hc * BD_Hc + bW_Mc * W_Mc + bW_Hc * W_Hc + bER_Mc * ER_Mc + bER_Hc * ER_Hc + bC_Mc * C_Mc + bC_Hc * C_Hc + bPc * price_c/ U(OO) = OO ;WTP = bBD_Muc/bPuc $ Additionally, when I try to add a component, namely the standard deviation of certainty so that I estimate four coefficients for each attribute (level) Nlogit 5 starts the estimation and after some time (+-10 min), it shuts down without showing an error message. The code that I used for this is: RPLOGIT ;lhs = choice ;Choices = 1, 2, OO ;Halton ;FCN = bBD_Mcl(n), bBD_Hcl(n), bW_Mcl(n), bW_Hcl(n), bER_Mcl(n), bER_Hcl(n), bC_Mcl(n), bC_Hcl(n), bBD_Mucl(n), bBD_Hucl(n), bW_Mucl(n), bW_Hucl(n), bER_Mucl(n), bER_Hucl(n), bC_Mucl(n), bC_Hucl(n), bBD_Much(n), bBD_Huch(n), bW_Much(n), bW_Huch(n), bER_Much(n), bER_Huch(n), bC_Much(n), bC_Huch(n), bBD_Mch(n), bBD_Hch(n), bW_Mch(n), bW_Hch(n), bER_Mch(n), bER_Hch(n), bC_Mch(n), bC_Hch(n) ;pts = 1000 ;pds = 6 ;Parameters ;Model: U(1,2) = bBD_Mucl * BD_Mucl + bBD_Hucl * BD_Hucl + bW_Mucl * W_Mucl + bW_Hucl * W_Hucl + bER_Mucl * ER_Mucl + bER_Hucl * ER_Hucl + bC_Mucl * C_Mucl + bC_Hucl * C_Hucl + bPucl * price_ul + bBD_Mcl * BD_Mcl + bBD_Hcl * BD_Hcl + bW_Mcl * W_Mcl + bW_Hcl * W_Hcl + bER_Mcl * ER_Mcl + bER_Hcl * ER_Hcl + bC_Mcl * C_Mcl + bC_Hcl * C_Hcl + bPcl * price_cl + bBD_Much * BD_Much + bBD_Huch * BD_Huch + bW_Much * W_Much + bW_Huch * W_Huch + bER_Much * ER_Much + bER_Huch * ER_Huch + bC_Much * C_Much + bC_Huch * C_Huch + bPuch * price_uh + bBD_Mch * BD_Mch + bBD_Hch * BD_Hch + bW_Mch * W_Mch + bW_Hch * W_Hch + bER_Mch * ER_Mch + bER_Hch * ER_Hch + bC_Mch * C_Mch + bC_Hch * C_Hch + bPch * price_ch/ U(OO) = OO $ Does anyone have an idea why nlogit shuts down? Is it too complex for the number of observations I have? Many thanks in advance. Best regards, Iris Vanermen From wgreene at stern.nyu.edu Tue Aug 24 01:27:24 2021 From: wgreene at stern.nyu.edu (William Greene) Date: Mon, 23 Aug 2021 11:27:24 -0400 Subject: [Limdep Nlogit List] Nlogit shuts down In-Reply-To: <69f9f8e4b2774827bd88a8d00a55a34b@ICTS-S-EXMBX17.luna.kuleuven.be> References: <69f9f8e4b2774827bd88a8d00a55a34b@ICTS-S-EXMBX17.luna.kuleuven.be> Message-ID: Iris. One would not expect the program to crash in any event. But, either way, your model is EXTREMELY ambitious. Having more than a handful of random parameters is very optimistic. I suspect that is the problem. As for saving WTP, whether that works depends on how many observations you have. The values are saved in a matrix, so the internal limit on cells for WTP is 50,000. You have a rather small sample, so this is not the issue. My guess is the huge size of the RP part of the model. You might try the estimation with most, then some of the RPs removed from the specification. Regards Bill Greene On Mon, Aug 23, 2021 at 9:41 AM Iris Vanermen wrote: > Dear community members, > > I am analyzing a discrete choice experiment and am trying to > simultaneously estimate certainty and preferences following the approach of > Rose, Beck & Hensher, 2015 ("The joint estimation of respondent-reported > certainty and acceptability with choice"), using the code below. This works > perfectly fine but when I try to include WTP calculations, Nlogit 5 shuts > down (I don't get an error message). My sample contains 143 individuals > that each received 6 choice cards with 3 alternatives (2 + opt-out). > > Without WTP: > RPLOGIT > ;lhs = choice > ;Choices = 1, 2, OO > ;Halton > ;pts = 1000 > ;pds = 6 > ;FCN = bBD_Muc(n), bBD_Huc(n), bW_Muc(n), bW_Huc(n), bER_Muc(n), > bER_Huc(n), bC_Muc(n), bC_Huc(n), bBD_Mc(n), > bBD_Hc(n), bW_Mc(n), bW_Hc(n), bER_Mc(n), bER_Hc(n), bC_Mc(n), bC_Hc(n) > ;Parameters > ;Model: > U(1,2) = bBD_Muc * BD_Muc + bBD_Huc * BD_Huc + bW_Muc * W_Muc + bW_Huc * > W_Huc + bER_Muc * ER_Muc + bER_Huc * ER_Huc > + bC_Muc * C_Muc + bC_Huc * C_Huc + bPuc * price_uc + bBD_Mc * BD_Mc + > bBD_Hc * BD_Hc + bW_Mc * W_Mc + bW_Hc * W_Hc > + bER_Mc * ER_Mc + bER_Hc * ER_Hc + bC_Mc * C_Mc + bC_Hc * C_Hc + bPc * > price_c/ > U(OO) = OO > $ > > With WTP: > RPLOGIT > ;lhs = choice > ;Choices = 1, 2, OO > ;Halton > ;pts = 1000 > ;pds = 6 > ;FCN = bBD_Muc(n), bBD_Huc(n), bW_Muc(n), bW_Huc(n), bER_Muc(n), > bER_Huc(n), bC_Muc(n), bC_Huc(n), bBD_Mc(n), > bBD_Hc(n), bW_Mc(n), bW_Hc(n), bER_Mc(n), bER_Hc(n), bC_Mc(n), bC_Hc(n) > ;Parameters > ;Model: > U(1,2) = bBD_Muc * BD_Muc + bBD_Huc * BD_Huc + bW_Muc * W_Muc + bW_Huc * > W_Huc + bER_Muc * ER_Muc + bER_Huc * ER_Huc > + bC_Muc * C_Muc + bC_Huc * C_Huc + bPuc * price_uc + bBD_Mc * BD_Mc + > bBD_Hc * BD_Hc + bW_Mc * W_Mc + bW_Hc * W_Hc > + bER_Mc * ER_Mc + bER_Hc * ER_Hc + bC_Mc * C_Mc + bC_Hc * C_Hc + bPc * > price_c/ > U(OO) = OO > ;WTP = bBD_Muc/bPuc > $ > > Additionally, when I try to add a component, namely the standard deviation > of certainty so that I estimate four coefficients for each attribute > (level) Nlogit 5 starts the estimation and after some time (+-10 min), it > shuts down without showing an error message. The code that I used for this > is: > RPLOGIT > ;lhs = choice > ;Choices = 1, 2, OO > ;Halton > ;FCN = bBD_Mcl(n), bBD_Hcl(n), bW_Mcl(n), bW_Hcl(n), bER_Mcl(n), > bER_Hcl(n), bC_Mcl(n), bC_Hcl(n), bBD_Mucl(n), bBD_Hucl(n), > bW_Mucl(n), bW_Hucl(n), bER_Mucl(n), bER_Hucl(n), bC_Mucl(n), bC_Hucl(n), > bBD_Much(n), bBD_Huch(n), bW_Much(n), bW_Huch(n), bER_Much(n), > bER_Huch(n), bC_Much(n), bC_Huch(n), bBD_Mch(n), bBD_Hch(n), bW_Mch(n), > bW_Hch(n), bER_Mch(n), bER_Hch(n), bC_Mch(n), bC_Hch(n) > ;pts = 1000 > ;pds = 6 > ;Parameters > ;Model: > U(1,2) = bBD_Mucl * BD_Mucl + bBD_Hucl * BD_Hucl + bW_Mucl * W_Mucl + > bW_Hucl * W_Hucl + bER_Mucl * ER_Mucl + bER_Hucl * ER_Hucl > + bC_Mucl * C_Mucl + bC_Hucl * C_Hucl + bPucl * price_ul + bBD_Mcl * > BD_Mcl + bBD_Hcl * BD_Hcl + bW_Mcl * W_Mcl + bW_Hcl * W_Hcl > + bER_Mcl * ER_Mcl + bER_Hcl * ER_Hcl + bC_Mcl * C_Mcl + bC_Hcl * C_Hcl + > bPcl * price_cl + bBD_Much * BD_Much + bBD_Huch * BD_Huch > + bW_Much * W_Much + bW_Huch * W_Huch + bER_Much * ER_Much + bER_Huch * > ER_Huch + bC_Much * C_Much + bC_Huch * C_Huch + bPuch * price_uh > + bBD_Mch * BD_Mch + bBD_Hch * BD_Hch + bW_Mch * W_Mch + bW_Hch * W_Hch + > bER_Mch * ER_Mch + bER_Hch * ER_Hch + bC_Mch * C_Mch + bC_Hch * C_Hch > + bPch * price_ch/ > U(OO) = OO > $ > > Does anyone have an idea why nlogit shuts down? Is it too complex for the > number of observations I have? > > Many thanks in advance. > Best regards, > Iris Vanermen > _______________________________________________ > Limdep site list > Limdep at mailman.sydney.edu.au > https://protect-au.mimecast.com/s/fSb_CmO5glujZWoYwFGyUX-?domain=limdep.itls.usyd.edu.au > > -- William Greene Department of Economics, emeritus Stern School of Business, New York University 44 West 4 St. New York, NY, 10012 URL: https://protect-au.mimecast.com/s/o6buCnx1jni7zmZL0FJ0wQf?domain=people.stern.nyu.edu Email: wgreene at stern.nyu.edu 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