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

# Re: st: QUAIDS Elasticities

 From solafem7@yahoo.co.uk To statalist@hsphsun2.harvard.edu Subject Re: st: QUAIDS Elasticities Date Thu, 29 Dec 2011 18:51:28 +0000

```You may need to Log your data. That is your prices and expenditure. If you are working with the real data, I think this problem might be there. You can check for this.
Sent from my BlackBerry wireless device from MTN

-----Original Message-----
From: Derya Karaci <dkaraci@yahoo.com>
Sender: owner-statalist@hsphsun2.harvard.edu
Date: Thu, 29 Dec 2011 10:33:00
To: statalist@hsphsun2.harvard.edu<statalist@hsphsun2.harvard.edu>
Subject: st: QUAIDS Elasticities

Hello,

I am trying to obtain QUAIDS elasticities after running Poi(2008) program to estimate a 5-good demand system. The formulas are provided by Banks,Blundell and Lewbel (RESTAT,1997) and I am trying to use the coefficients to compute the elasticities for each household with predictnl. The code seems to work fine but I am obtaining unusually large own-price elasticities (mostly greater than one in absolute value) which are inconsistent with the literature. I post my code below. Am I making a mistake in the implementation of the formulas? Any help will be greatly appreciated!

I tried to run it on the average values (instead of obtaining an elasticity matrix for each household) but that also gave very large elasticities.

Many thanks in advance... and merry Christmas!

Derya

Note: I know gammas are variables, not parameters but I couldn't get it to work otherwise.

******************************************************************************************************************
nlsur quaids3 @ w1 w2 w3 w4 lnp1-lnp5 lnexp var1 var2 var3 var4, ifgnls nequations(4) ///
param(a1 a2 a3 a4 b1 b2 b3 b4 g11 g12 g13 g14 g22 g23 g24 g34 g33 g44 l1 l2 l3 l4 ///
h1 h2 h3 h4 r1 r2 r3 r4 j1 j2 j3 j4 k1 k2 k3 k4)

estimates save est

* Recover the parameters of fifth equation:
*-------------------------------------------
estimates use est
nlcom (a1:_b[/a1]) (a2:_b[/a2]) (a3:_b[/a3]) (a4:_b[/a4]) ///
(a5:1-_b[/a1]-_b[/a2]-_b[/a3]- _b[/a4]) ///
.......(more stuff)
(l5:-_b[/l1]-_b[/l2]-_b[/l3]-_b[/l4]), iterate(1000) post

***post missing gamma
*-------------------------------------------forvalues i=1/5{          gen gama1`i'=_b[g1`i']
}

forvalues i=2/5{
forvalues j=1/5{
if `i'>`j' {
gen gama`i'`j'=_b[g`j'`i']
}
else {
gen gama`i'`j'=_b[g`i'`j']
}

}
}

*** Generate b(p):
gen double bp=p1^_b[b1]*p2^_b[b2]*p3^_b[b3]*p4^_b[b4]*p5^_b[b5]

*** Generate P(p):
gen double lnap = 4.9 + _b[a1]*lnp1 + _b[a2]*lnp2 + _b[a3]*lnp3 + _b[a4]*lnp4 +_b[a5]*lnp5
forvalues i = 1/5 {
forvalues j = 1/5 {
replace lnap = lnap + 0.5*gama`i'`j'*lnp`i'*lnp`j'
}}

***Budget elasticities

forvalues i=1/5{
predictnl  e`i' = _b[b`i']+((2*_b[l`i']/bp)*(lnexp-lnap))/w`i' + 1, se(se`i')
}

****Price elasticities (uncompensated)
forvalues i=1/5{          forvalues j=1/5{
gen gp`j'=0
forvalues l=1/5{
replace gp`j'=gp`j'+gama`j'`l' * lnp`l'
}
if `i'==`j'{
local delt=1
}
else {
local delt=0
}
predictnl e`i'`j'= (((gama`i'`j' - (( _b[b`i']+((2*_b[l`i']/bp)*(lnexp-lnap))))* ///
(_b[a`j'] + gp`j') - (_b[l`i']*_b[b`j']/bp)*(lnexp-lnap)^2 )))/w`i' - `delt' ///
, se(se`i'`j')
drop gp`j'
}
}

*
*   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/
```