From alessandro.corsi at unito.it Sat Mar 5 03:39:39 2022 From: alessandro.corsi at unito.it (Alessandro Corsi) Date: Fri, 4 Mar 2022 17:39:39 +0100 Subject: [Limdep Nlogit List] Weighting in quantile regression Message-ID: Does the WTS; specification work with the QREG; model, and with the Quantiles; command? (I am using Nlogit 6) The WTS specification seems to produce no effect on the estimation. I run the following: ? ? QREG;Lhs=meatprot; Rhs=one,gdppc;quantile=.25 $ (output below) and obtained exactly the same output with:?? QREG;Lhs=meatprot; Rhs=one,gdppc;quantile=.25; wts= populati $ (though it signals a weighting variable, see below) Moreover, when checking the data with: QUANTILES;? rhs=meatprot$ I got exactly the same results as with: QUANTILES; rhs=meatprot; wts= populati $ Thanks for clarifications Alessandro Corsi QREG;Lhs=meatprot; Rhs=one,gdppc;quantile=.25 $ ----------------------------------------------------------------------------- Quantile Regression Model. Quantile =????? .250000 Linear Programming estimation method LHS=MEATPROT Mean???????????????? =?????? 16.28292 ???????????? Standard deviation?? =?????? 10.97889 ???????????? Number of observs.?? =?????????? 2296 ???????????? Minimum????????????? =??????? 1.16000 ???????????? t= .25000 quantile?? =??????? 6.29000 ???????????? Maximum????????????? =?????? 46.93000 Model size?? Parameters?????????? =????????????? 2 ???????????? Degrees of freedom?? =?????????? 2294 Residuals??? Sum of squares?????? =?? 160762.75237 ???????????? Standard error of e? =??????? 7.06346 Fit????????? R-squared??????????? =???????? .58608 ???????????? PseudoR2=1-F(0)/F(b) =???????? .37028 Not using OLS or no constant. Rsquared may be <= 0 Functions F= Sum r(t)[y(i)-x(i)b] =???? 4459.21969 ????????? F0=Sum r(t)[y(i)-Qy(t)] =???? 7081.28500 ???????????? r(t)[u]=t*u-u*[u<0].t=??????? .250000 Asymptotic cov. matrix based on? kernel estimator. Heteroscedasticity test, Chi2[ 1] =237.11 P = .000 --------+-------------------------------------------------------------------- ??????? |????????????????? Standard??????????? Prob.????? 95% Confidence MEATPROT|? Coefficient?????? Error?????? z??? |z|>Z* Interval --------+-------------------------------------------------------------------- Constant|??? 3.27656***????? .20597??? 15.91? .0000 2.87286?? 3.68026 ?? GDPPC|???? .00048***?? .9048D-05??? 53.21? .0000 .00046??? .00050 --------+-------------------------------------------------------------------- nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx. ***, **, * ==>? Significance at 1%, 5%, 10% level. Model was estimated on Mar 04, 2022 at 04:43:31 PM ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- Quantile Regression Model. Quantile =????? .250000 Linear Programming estimation method LHS=MEATPROT Mean???????????????? =?????? 16.28292 ???????????? Standard deviation?? =?????? 10.97889 WTS=POPULATI Number of observs.?? =?????????? 2296 ???????????? Minimum????????????? =??????? 1.16000 ???????????? t= .25000 quantile?? =??????? 6.29000 ???????????? Maximum????????????? =?????? 46.93000 Model size?? Parameters?????????? =????????????? 2 ???????????? Degrees of freedom?? =?????????? 2294 Residuals??? Sum of squares?????? =?? 160762.75237 ???????????? Standard error of e? =??????? 7.06346 Fit????????? R-squared??????????? =???????? .58608 ???????????? PseudoR2=1-F(0)/F(b) =???????? .37028 Not using OLS or no constant. Rsquared may be <= 0 Functions F= Sum r(t)[y(i)-x(i)b] =???? 4459.21969 ????????? F0=Sum r(t)[y(i)-Qy(t)] =???? 7081.28500 ???????????? r(t)[u]=t*u-u*[u<0].t=??????? .250000 Asymptotic cov. matrix based on? kernel estimator. Heteroscedasticity test, Chi2[ 1] =237.11 P = .000 --------+-------------------------------------------------------------------- ??????? |????????????????? Standard??????????? Prob.????? 95% Confidence MEATPROT|? Coefficient?????? Error?????? z??? |z|>Z* Interval --------+-------------------------------------------------------------------- Constant|??? 3.27656***????? .20597??? 15.91? .0000 2.87286?? 3.68026 ?? GDPPC|???? .00048***?? .9048D-05??? 53.21? .0000 .00046??? .00050 --------+-------------------------------------------------------------------- nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx. ***, **, * ==>? Significance at 1%, 5%, 10% level. Model was estimated on Mar 04, 2022 at 04:43:59 PM ----------------------------------------------------------------------------- QREG;Lhs=meatprot; Rhs=one,gdppc;quantile=.25; wts= populati $ ----------------------------------------------------------------------------- Quantile Regression Model. Quantile =????? .250000 Linear Programming estimation method LHS=MEATPROT Mean???????????????? =?????? 16.28292 ???????????? Standard deviation?? =?????? 10.97889 WTS=POPULATI Number of observs.?? =?????????? 2296 ???????????? Minimum????????????? =??????? 1.16000 ???????????? t= .25000 quantile?? =??????? 6.29000 ???????????? Maximum????????????? =?????? 46.93000 Model size?? Parameters?????????? =????????????? 2 ???????????? Degrees of freedom?? =?????????? 2294 Residuals??? Sum of squares?????? =?? 160762.75237 ???????????? Standard error of e? =??????? 7.06346 Fit????????? R-squared??????????? =???????? .58608 ???????????? PseudoR2=1-F(0)/F(b) =???????? .37028 Not using OLS or no constant. Rsquared may be <= 0 Functions F= Sum r(t)[y(i)-x(i)b] =???? 4459.21969 ????????? F0=Sum r(t)[y(i)-Qy(t)] =???? 7081.28500 ???????????? r(t)[u]=t*u-u*[u<0].t=??????? .250000 Asymptotic cov. matrix based on? kernel estimator. Heteroscedasticity test, Chi2[ 1] =237.11 P = .000 --------+-------------------------------------------------------------------- ??????? |????????????????? Standard??????????? Prob.????? 95% Confidence MEATPROT|? Coefficient?????? Error?????? z??? |z|>Z* Interval --------+-------------------------------------------------------------------- Constant|??? 3.27656***????? .20597??? 15.91? .0000 2.87286?? 3.68026 ?? GDPPC|???? .00048***?? .9048D-05??? 53.21? .0000 .00046??? .00050 --------+-------------------------------------------------------------------- nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx. ***, **, * ==>? Significance at 1%, 5%, 10% level. Model was estimated on Mar 04, 2022 at 04:43:59 PM ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- Quantile Regression Model. Quantile =????? .250000 Linear Programming estimation method LHS=MEATPROT Mean???????????????? =?????? 16.28292 ???????????? Standard deviation?? =?????? 10.97889 WTS=POPULATI Number of observs.?? =?????????? 2296 ???????????? Minimum????????????? =??????? 1.16000 ???????????? t= .25000 quantile?? =??????? 6.29000 ???????????? Maximum????????????? =?????? 46.93000 Model size?? Parameters?????????? =????????????? 2 ???????????? Degrees of freedom?? =?????????? 2294 Residuals??? Sum of squares?????? =?? 160762.75237 ???????????? Standard error of e? =??????? 7.06346 Fit????????? R-squared??????????? =???????? .58608 ???????????? PseudoR2=1-F(0)/F(b) =???????? .37028 Not using OLS or no constant. Rsquared may be <= 0 Functions F= Sum r(t)[y(i)-x(i)b] =???? 4459.21969 ????????? F0=Sum r(t)[y(i)-Qy(t)] =???? 7081.28500 ???????????? r(t)[u]=t*u-u*[u<0].t=??????? .250000 Asymptotic cov. matrix based on? kernel estimator. Heteroscedasticity test, Chi2[ 1] =237.11 P = .000 --------+-------------------------------------------------------------------- ??????? |????????????????? Standard??????????? Prob.????? 95% Confidence MEATPROT|? Coefficient?????? Error?????? z??? |z|>Z* Interval --------+-------------------------------------------------------------------- Constant|??? 3.27656***????? .20597??? 15.91? .0000 2.87286?? 3.68026 ?? GDPPC|???? .00048***?? .9048D-05??? 53.21? .0000 .00046??? .00050 --------+-------------------------------------------------------------------- nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx. ***, **, * ==>? Significance at 1%, 5%, 10% level. Model was estimated on Mar 04, 2022 at 04:43:59 PM ----------------------------------------------------------------------------- Moreover, when checking the data with: QUANTILES;? rhs=meatprot$ I got exactly the same results as with: QUANTILES; rhs=meatprot; wts= populati $ Thanks for clarifications Alessandro Corsi -- Questa e-mail ? stata controllata per individuare virus con Avast antivirus. https://protect-au.mimecast.com/s/dAjECVARKgCxWg0p0SGx6sg?domain=avast.com From wgreene at stern.nyu.edu Sun Mar 6 07:52:04 2022 From: wgreene at stern.nyu.edu (William Greene) Date: Sat, 5 Mar 2022 15:52:04 -0500 Subject: [Limdep Nlogit List] Weighting in quantile regression In-Reply-To: References: Message-ID: Quantile regression is computed using linear programming, not by any kind of moments. There is no way to incorporating a "weighting" arrangement. Weighting request is ignored by QREG. In principle, you could scale the data. But, an observation that gets a higher scale still does not obtain greater prominence in the estimator. /B. Greene On Fri, Mar 4, 2022 at 11:39 AM Alessandro Corsi wrote: > Does the WTS; specification work with the QREG; model, and with the > Quantiles; command? (I am using Nlogit 6) The WTS specification seems to > produce no effect on the estimation. > > I run the following: QREG;Lhs=meatprot; Rhs=one,gdppc;quantile=.25 $ > (output below) > > and obtained exactly the same output with: QREG;Lhs=meatprot; > Rhs=one,gdppc;quantile=.25; wts= populati $ > > (though it signals a weighting variable, see below) > > Moreover, when checking the data with: QUANTILES; rhs=meatprot$ > > I got exactly the same results as with: QUANTILES; rhs=meatprot; wts= > populati $ > > Thanks for clarifications > > Alessandro Corsi > > > QREG;Lhs=meatprot; Rhs=one,gdppc;quantile=.25 $ > > > ----------------------------------------------------------------------------- > Quantile Regression Model. Quantile = .250000 > Linear Programming estimation method > LHS=MEATPROT Mean = 16.28292 > Standard deviation = 10.97889 > Number of observs. = 2296 > Minimum = 1.16000 > t= .25000 quantile = 6.29000 > Maximum = 46.93000 > Model size Parameters = 2 > Degrees of freedom = 2294 > Residuals Sum of squares = 160762.75237 > Standard error of e = 7.06346 > Fit R-squared = .58608 > PseudoR2=1-F(0)/F(b) = .37028 > Not using OLS or no constant. Rsquared may be <= 0 > Functions F= Sum r(t)[y(i)-x(i)b] = 4459.21969 > F0=Sum r(t)[y(i)-Qy(t)] = 7081.28500 > r(t)[u]=t*u-u*[u<0].t= .250000 > Asymptotic cov. matrix based on kernel estimator. > Heteroscedasticity test, Chi2[ 1] =237.11 P = .000 > > --------+-------------------------------------------------------------------- > | Standard Prob. 95% Confidence > MEATPROT| Coefficient Error z |z|>Z* Interval > > --------+-------------------------------------------------------------------- > Constant| 3.27656*** .20597 15.91 .0000 2.87286 3.68026 > GDPPC| .00048*** .9048D-05 53.21 .0000 .00046 .00050 > > --------+-------------------------------------------------------------------- > nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx. > ***, **, * ==> Significance at 1%, 5%, 10% level. > Model was estimated on Mar 04, 2022 at 04:43:31 PM > > ----------------------------------------------------------------------------- > > > ----------------------------------------------------------------------------- > Quantile Regression Model. Quantile = .250000 > Linear Programming estimation method > LHS=MEATPROT Mean = 16.28292 > Standard deviation = 10.97889 > WTS=POPULATI Number of observs. = 2296 > Minimum = 1.16000 > t= .25000 quantile = 6.29000 > Maximum = 46.93000 > Model size Parameters = 2 > Degrees of freedom = 2294 > Residuals Sum of squares = 160762.75237 > Standard error of e = 7.06346 > Fit R-squared = .58608 > PseudoR2=1-F(0)/F(b) = .37028 > Not using OLS or no constant. Rsquared may be <= 0 > Functions F= Sum r(t)[y(i)-x(i)b] = 4459.21969 > F0=Sum r(t)[y(i)-Qy(t)] = 7081.28500 > r(t)[u]=t*u-u*[u<0].t= .250000 > Asymptotic cov. matrix based on kernel estimator. > Heteroscedasticity test, Chi2[ 1] =237.11 P = .000 > > --------+-------------------------------------------------------------------- > | Standard Prob. 95% Confidence > MEATPROT| Coefficient Error z |z|>Z* Interval > > --------+-------------------------------------------------------------------- > Constant| 3.27656*** .20597 15.91 .0000 2.87286 3.68026 > GDPPC| .00048*** .9048D-05 53.21 .0000 .00046 .00050 > > --------+-------------------------------------------------------------------- > nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx. > ***, **, * ==> Significance at 1%, 5%, 10% level. > Model was estimated on Mar 04, 2022 at 04:43:59 PM > > ----------------------------------------------------------------------------- > > > QREG;Lhs=meatprot; Rhs=one,gdppc;quantile=.25; wts= populati $ > > > ----------------------------------------------------------------------------- > Quantile Regression Model. Quantile = .250000 > Linear Programming estimation method > LHS=MEATPROT Mean = 16.28292 > Standard deviation = 10.97889 > WTS=POPULATI Number of observs. = 2296 > Minimum = 1.16000 > t= .25000 quantile = 6.29000 > Maximum = 46.93000 > Model size Parameters = 2 > Degrees of freedom = 2294 > Residuals Sum of squares = 160762.75237 > Standard error of e = 7.06346 > Fit R-squared = .58608 > PseudoR2=1-F(0)/F(b) = .37028 > Not using OLS or no constant. Rsquared may be <= 0 > Functions F= Sum r(t)[y(i)-x(i)b] = 4459.21969 > F0=Sum r(t)[y(i)-Qy(t)] = 7081.28500 > r(t)[u]=t*u-u*[u<0].t= .250000 > Asymptotic cov. matrix based on kernel estimator. > Heteroscedasticity test, Chi2[ 1] =237.11 P = .000 > > --------+-------------------------------------------------------------------- > | Standard Prob. 95% Confidence > MEATPROT| Coefficient Error z |z|>Z* Interval > > --------+-------------------------------------------------------------------- > Constant| 3.27656*** .20597 15.91 .0000 2.87286 3.68026 > GDPPC| .00048*** .9048D-05 53.21 .0000 .00046 .00050 > > --------+-------------------------------------------------------------------- > nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx. > ***, **, * ==> Significance at 1%, 5%, 10% level. > Model was estimated on Mar 04, 2022 at 04:43:59 PM > > ----------------------------------------------------------------------------- > > > ----------------------------------------------------------------------------- > Quantile Regression Model. Quantile = .250000 > Linear Programming estimation method > LHS=MEATPROT Mean = 16.28292 > Standard deviation = 10.97889 > WTS=POPULATI Number of observs. = 2296 > Minimum = 1.16000 > t= .25000 quantile = 6.29000 > Maximum = 46.93000 > Model size Parameters = 2 > Degrees of freedom = 2294 > Residuals Sum of squares = 160762.75237 > Standard error of e = 7.06346 > Fit R-squared = .58608 > PseudoR2=1-F(0)/F(b) = .37028 > Not using OLS or no constant. Rsquared may be <= 0 > Functions F= Sum r(t)[y(i)-x(i)b] = 4459.21969 > F0=Sum r(t)[y(i)-Qy(t)] = 7081.28500 > r(t)[u]=t*u-u*[u<0].t= .250000 > Asymptotic cov. matrix based on kernel estimator. > Heteroscedasticity test, Chi2[ 1] =237.11 P = .000 > > --------+-------------------------------------------------------------------- > | Standard Prob. 95% Confidence > MEATPROT| Coefficient Error z |z|>Z* Interval > > --------+-------------------------------------------------------------------- > Constant| 3.27656*** .20597 15.91 .0000 2.87286 3.68026 > GDPPC| .00048*** .9048D-05 53.21 .0000 .00046 .00050 > > --------+-------------------------------------------------------------------- > nnnnn.D-xx or D+xx => multiply by 10 to -xx or +xx. > ***, **, * ==> Significance at 1%, 5%, 10% level. > Model was estimated on Mar 04, 2022 at 04:43:59 PM > > ----------------------------------------------------------------------------- > > > > Moreover, when checking the data with: QUANTILES; rhs=meatprot$ > > I got exactly the same results as with: QUANTILES; rhs=meatprot; wts= > populati $ > > Thanks for clarifications > > Alessandro Corsi > > > -- > Questa e-mail ? stata controllata per individuare virus con Avast > antivirus. > https://protect-au.mimecast.com/s/hpssC0YKPviG74YVoFwNXHk?domain=avast.com > _______________________________________________ > Limdep site list > Limdep at mailman.sydney.edu.au > https://protect-au.mimecast.com/s/hLtaCgZ0N1iAoN490ToKcei?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/fGeqCjZ1N7inBAZ85U5K8VM?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 u19400251 at tuks.co.za Wed Mar 9 00:04:57 2022 From: u19400251 at tuks.co.za (Namatirai Cheure) Date: Tue, 8 Mar 2022 15:04:57 +0200 Subject: [Limdep Nlogit List] Latent Class Nested Logit Models in NLogit Message-ID: Hi, Is it possible to run a Latent Class Nested Logit Model in NLogit? I managed to run the LC-MNL model but I cannot find an LC-NL model example in the reference guide. Thanks. Prayers -- This message and attachments are subject to a disclaimer. Please refer to https://protect-au.mimecast.com/s/n6grCmO5glujgq4JKfGl6ji?domain=it.up.ac.za for full details.