Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

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

From |
nigussie Tefera <nitefera@yahoo.com> |

To |
"statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |

Subject |
Re: st: QUAIDS |

Date |
Sun, 27 Jan 2013 03:48:27 -0800 (PST) |

Dear Murat and Kolawole, Thanks a lot for your the help! As both of you rightly said, I am planning to multiply the CFD variables by all variables and it is only PDF variables that is going to be additional variables in the estimation techniques. The "nlsurquaidsNNP" program that I tried to write did exactly in the same way. The CDF is multiplied with the all variables and the PDF is the additional variables to the system. In my first post, I didn't spell it out properly, I am sorry for that. In fact, Shonkwiler and Yen (1999) warned that the share of expenditure will not be added up to one, as you also mentioned, and they suggest running full set of equations rather than for N-1 equations. However, Yen, Lin, and Smallwood (2003) as cited in Zheng and Henneberry (2010) suggested to recalculate share of one of the food items under study in such a way that the adding property to be hold. i.e. if Si=wi+πPDFi . where si is the new budget share and wi the original budget share and PDF is the probability density function derived from the first-stage multivariate probit function. Then they indicated the Sn=1- . I want to apply the same approach and exclude one of the food items in estimating the demand equations so as to control for singularity. And also as both of you mentioned correcting for the standard error is one of the difficulties in using this approaches. I think there are research works on progress to correct for it. In estimating the elasticities, again, we need to take into accounts the CDF and PDF variables and hence the standard formula for elasticity estimate doesn’t apply once the system is controlled for CDF and PDF variables. I prefer to use the recently released Boi’s quaids stata program to estimate the system (may be with modification) but I am not yet sure whether the program is already controlled for observed zero consumption expenditure as suggested by Shonkwiler and Yen(1999). Dear Dr. Poi, I need your suggestion in this regard. Best Nigussie ----- Original Message ----- From: ogundarikolawole <ogundarikolawole@daad-alumni.de> To: "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> Cc: Sent: Sunday, January 27, 2013 5:47 AM Subject: RE: st: QUAIDS Dear Nigussie, I strongly agree the suggestions of Murat. I was a bit skeptical when I saw your original post, especially when you mentioned that you are interested in Shonkwiler and Yen method of incoporating CDF and PDF instead of using the traditional mills inverse ratio, but went ahead in the code that you dropped one of the equations to avoid singularity. As mentioned by Murat, if you are indeed following Shonkwiler and Yen method , then the adding up criteria is no longer holding. All the share equations will be estimated once, simply because you must have transform the share equations by multiplying these share equation by their respective CDF before the estimation. And by the way you made mentioned that the CDF was included as one of the variables in addition with PDF. I think that is not correct, because if you read the Yen's later papers very clearly, its only the PDF that was included while CDF was only used to transform the share equations. In addition, correcting for the standard error is another issue of concern and even Yen mentioned in his papers that the best estimator for these censore data in FGLS. I will advice as mentioned by Murat that you modify the code in order to estimate the equations once and better still use recebtly released Boi's stata program, which I believe might work for the Shonkwiler and Yen method . Good luck Kolawole Dr. Kolawole OGUNDARI JSPS Research Fellow Laboratory of Agricultural and Farm Management, Dept. of Agricultural and Resources Economics, Faculty of Agriculture, Kyushu University, Hakozaki 6-10-1, Fukuoka, 812-8581, Japan. ________________________________________ From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Murat Genc [murat.genc@otago.ac.nz] Sent: Sunday, January 27, 2013 1:22 AM To: 'statalist@hsphsun2.harvard.edu' Subject: RE: st: QUAIDS Dear Nigussie, Yes, but Shonkwiler and Yen method incorporates the CDF in a different way by multiplying them with all the variables in the model. You seem to be including it as an additional variable on its own. A couple warnings. It is stated in the literature that the adding-up property does not hold for the estimated demand system when Shonkwiler and Yen correction is applied. So, it is suggested that no equation should be dropped. You need to modify the quaids command in order to achieve this, since it automatically drops one of the equations. Furthermore, the standard errors need to be corrected. Also, you are probably going to calculate the price elasticities. You need to do this manually, since the formulae quaids uses do not apply when this correction is applied. And be very careful when you do this. The formulae for elasticities that I have seen in the literature differ. And I have not seen one that is correct yet! (Most papers don't even state them.) All the best Murat -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of nigussie Tefera Sent: Sunday, 27 January 2013 9:19 a.m. To: statalist@hsphsun2.harvard.edu Subject: Re: st: QUAIDS Dear Poi and Murat, Thanks a lot, indeed. Dear Poi, once I have corrected for the omitted /// the program run as you said. I didn't know that you already developed 'quaids" command in the statat but just checked it now. It is much easier and very simply to run. I would like to thank you very much for simplifying demand estimation techniques. Your quaids.ado includes household demographic variables in system of demand estimation. This is really a very good progress. However, I am not sure whether it helps to incorporate consistent two-step (CTS) estimation procedure so as to control for any bias for zero consumption expenditure it was suggested by Shonkwiler and Yen (1999) (univariate approaches) and later on modified by Yen,Kan, and Su (2002) (multivariate approaches). Dear Murat, I am trying to employ the consistent two-step (CTS) estimation procedure for a system of equations with limited variables, proposed by Shonkwiler and Yen (1999), to account for zero expenditure shares resulting from missing values. The first step of CTS procedure involves a probit regression to determine the probability of consumption and hence predicting CDF and PDF. The predicted CDF and PDF is included in the second step while estimating QUAIDS. Best Nigussie ----- Original Message ----- From: Brian P. Poi <bpoi@stata.com> To: statalist@hsphsun2.harvard.edu Cc: Sent: Saturday, January 26, 2013 6:24 PM Subject: Re: st: QUAIDS On 01/26/2013 02:10 AM, nigussie Tefera wrote: > Dear stata list users, > > I am trying to modify Poi's (2008) nlsurqaids.ado incorporte household > demographics and village/regional dummies in the system as well as to > include commulative distribution function (CDF) and probability > distribution (CDF) so as to take into account bias due to zero > consumtion expenditure (observed zero consumption expenditure). But I > do not seem to be able to create a function evaluator program. I > suppose I am missing something obvious… > > Here is the program : > > program nlsurquaidsNNP > version 12.1 > > syntax varlist(min=16 max=16) if, at(name) > > tokenize `varlist' > args w1 w2 w3 lnp1 lnp2 lnp3 lnp4 lnm x1 x2 pdf1 pdf2 pdf3 cdf1 cdf2 >cdf3 > > // With four goods, there are 15 parameters that can be > // estimated, after eliminating one of the goods and > // imposing adding up, symmetry, and homogeneity > // constraints, in the QUAIDS model > // Here, we extract those parameters from the `at' > // vector, and impose constraints as we go along > tempname a1 a2 a3 a4 > scalar `a1' = `at'[1,1] > scalar `a2' = `at'[1,2] > scalar `a3' = `at'[1,3] > scalar `a4' = 1 - `a1' - `a2' - `a3' > > tempname b1 b2 b3 b4 > scalar `b1' = `at'[1,4] > scalar `b2' = `at'[1,5] > scalar `b3' = `at'[1,6] > scalar `b4' = -`b1' - `b2' - `b3' > tempname g11 g12 g13 g14 > tempname g21 g22 g23 g24 > tempname g31 g32 g33 g34 > tempname g41 g42 g43 g44 > scalar `g11' = `at'[1,7] > scalar `g12' = `at'[1,8] > scalar `g13' = `at'[1,9] > scalar `g14' = -`g11' - `g12' - `g13' > scalar `g21' = `g12' > scalar `g22' = `at'[1,10] > scalar `g23' = `at'[1,11] > scalar `g24' = -`g21' - `g22' - `g23' > scalar `g31' = `g13' > scalar `g32' = `g23' > scalar `g33' = `at'[1,12] > scalar `g34' = -`g31' - `g32' - `g33' > scalar `g41' = `g14' > scalar `g42' = `g24' > scalar `g43' = `g34' > scalar `g44' = -`g41' - `g42' - `g43' > > tempname l1 l2 l3 l4 > scalar `l1' = `at'[1,13] > scalar `l2' = `at'[1,14] > scalar `l3' = `at'[1,15] > scalar `l4' = -`l1' - `l2' - `l3' > > // constant and household demographics > tempname r11 r12 > tempname r21 r22 > tempname r31 r32 > scalar `r11' = `at'[1,16] > scalar `r12' = `at'[1,17] > scalar `r21' = `at'[1,18] > scalar `r22' = `at'[1,19] > scalar `r31' = `at'[1,20] > scalar `r32' = `at'[1,21] > > // pdf > tempname d1 d2 d3 > scalar `d1' = `at'[1,22] > scalar `d2' = `at'[1,23] > scalar `d3' = `at'[1,24] > > // Okay, now that we have all the parameters, we can > // calculate the expenditure shares. > quietly { > // First get the price index > // I set a_0 = 5 > tempvar lnpindex > gen double `lnpindex' = 5 + `a1'*`lnp1' + `a2'*`lnp2' /// > + `a3'*`lnp3' + `a4'*`lnp4' > forvalues i = 1/4 { > forvalues j = 1/4 { > replace `lnpindex' = `lnpindex' + /// > 0.5*`g`i'`j''*`lnp`i''*`lnp`j'' > } > } > // The b(p) term in the QUAIDS model: > tempvar bofp > gen double `bofp' = 0 > forvalues i = 1/4 { > replace `bofp' = `bofp' + `lnp`i''*`b`i'' > } > replace `bofp' = exp(`bofp') > // Finally, the expenditure shares for 3 of the 4 > // goods (the fourth is dropped to avoid singularity) > replace `w1' = (`a1' + `g11'*`lnp1' + `g12'*`lnp2' + /// > `g13'*`lnp3' + `g14'*`lnp4' + /// > `b1'*(`lnm' - `lnpindex') + /// > `l1'/`bofp'*(`lnm' - `lnpindex')^2 + /// > `r11'*`x1' +`r12'*`x2')*`cdf1'+ > `d1'*`pdf1' > > replace `w2' = (`a2' + `g21'*`lnp1' + `g22'*`lnp2' + /// > `g23'*`lnp3' + `g24'*`lnp4' + /// > `b2'*(`lnm' - `lnpindex') + /// > `l2'/`bofp'*(`lnm' - `lnpindex')^2 + /// > `r21'*`x1' +`r22'*`x2')*`cdf2' + > `d2'*`pdf2' > replace `w3' = (`a3' + `g31'*`lnp1' + `g32'*`lnp2' + /// > `g33'*`lnp3' + `g34'*`lnp4' + /// > `b3'*(`lnm' - `lnpindex') + /// > `l3'/`bofp'*(`lnm' - `lnpindex')^2 + /// > `r31'*`x1' +`r32'*`x2')*`cdf3' + > `d3'*`pdf3' > } > > end > > using food.dta data of Poi's (2008), I tried to run the programe but > it came up with "nlsurquaidsNNP returned 198 verify that nlsurquaidsNNP is a function evaluator program" > > I would apperciate any suggestion or help... > > Nigussie > Nigussie, Murat is correct: try using the -quaids- command instead. It's much easier to use! Just type in . findit quaids and click on the link for the article that appeared in SJ-12-3. The help file will get you started. Having said that, in the -replace- statements at the bottom of your program, you omitted the /// on the penultimate line of each one. If I change > replace `w3' = (`a3' + `g31'*`lnp1' + `g32'*`lnp2' + /// > `g33'*`lnp3' + `g34'*`lnp4' + /// > `b3'*(`lnm' - `lnpindex') + /// > `l3'/`bofp'*(`lnm' - `lnpindex')^2 + /// > `r31'*`x1' +`r32'*`x2')*`cdf3' + > `d3'*`pdf3' to > replace `w3' = (`a3' + `g31'*`lnp1' + `g32'*`lnp2' + /// > `g33'*`lnp3' + `g34'*`lnp4' + /// > `b3'*(`lnm' - `lnpindex') + /// > `l3'/`bofp'*(`lnm' - `lnpindex')^2 + /// > `r31'*`x1' +`r32'*`x2')*`cdf3' + /// > `d3'*`pdf3' and likewise for the other two -replace- statements, your program does run. -- Brian Poi -- bpoi@stata.com * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: QUAIDS***From:*"Brian P. Poi" <bpoi@stata.com>

**References**:**st: QUAIDS***From:*nigussie Tefera <nitefera@yahoo.com>

**Re: st: QUAIDS***From:*"Brian P. Poi" <bpoi@stata.com>

**Re: st: QUAIDS***From:*nigussie Tefera <nitefera@yahoo.com>

**RE: st: QUAIDS***From:*Murat Genc <murat.genc@otago.ac.nz>

**RE: st: QUAIDS***From:*ogundarikolawole <ogundarikolawole@daad-alumni.de>

- Prev by Date:
**R: st: advice on using Stata in an undergraduate Intro Stats course** - Next by Date:
**st: Multinomial regression using panel data with case-specific regressors only** - Previous by thread:
**RE: st: QUAIDS** - Next by thread:
**Re: st: QUAIDS** - Index(es):