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]
st: How to calculate unconditional elasticites from different output files using nlcom
From
Valerie Orozco <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: How to calculate unconditional elasticites from different output files using nlcom
Date
Thu, 12 Sep 2013 07:58:13 +0000
Dear Matteo,
I used to have the same question some years ago.
I used nlcom with the "post" option, saving the conditional elasticities into matrix, for each step (stage).
Then, I build a big matrix of all the new coefficients and a big matrix of variance covariance too (a diagonal one, not the true one). I linked the both, and used this new "estimation" with nlcom to calculate my unconditional elasticities.
Let's take an example (formula aren't right here, it's just to show you how it can work) :
/*Model for step 1*/
reg3 (w1 lnp1 lnp4 lnp9) ( w6 lnp10 lnp14 lnp3)
/*Conditionnal elasticities for step 1 using nlcom and posting the new estimation*/
nlcom (Elas1Step1 : _b[w1:lnp1]/_b[w6:lnp14]) (Elas2Step1 : _b[w1:lnp4]/_b[w6:lnp10]), post
Elas1Step1: _b[w1:lnp1]/_b[w6:lnp14]
Elas2Step1: _b[w1:lnp4]/_b[w6:lnp10]
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
Elas1Step1 | 1.067076 4.756888 0.22 0.823 -8.256254 10.39041
Elas2Step1 | -.1161965 .4674547 -0.25 0.804 -1.032391 .7999978
------------------------------------------------------------------------------
mat BStep1=e(b)
mat VStep1=e(V)
/*Model for step 2*/
reg3 (w16 lnp1 lnp4 lnp10) ( w3 lnp10 lnp14 lnp3) ( w9 lnp19 lnp16 lnp21)
/*Conditionnal elasticities for step 2 using nlcom and posting the new estimation*/
nlcom (ElasStep2 : _b[w16:lnp10]/_b[w3:lnp14]+_b[w9:lnp21]), post
ElasStep2: _b[w16:lnp10]/_b[w3:lnp14]+_b[w9:lnp21]
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ElasStep2 | 1.732858 1.548008 1.12 0.263 -1.301182 4.766897
------------------------------------------------------------------------------
mat BStep2=e(b)
mat VStep2=e(V)
/*Create matrix of coefficients of the different conditionnal elasticities*/
mat B=BStep1,BStep2
/*Create matrix of variance-covariance of the coefficients of the different conditionnal elasticities*/
/*(only variances since estimations are independant)*/
mat V=J(3,3,0)
mat V[1,1] = VStep1[1,1]
mat V[2,2] = VStep1[2,2]
mat V[3,3] = VStep2
matrix colnames V = Elas1Step1 Elas2Step1 ElasStep2
matrix rownames V = Elas1Step1 Elas2Step1 ElasStep2
mat list B
mat list V
/*Link B and V and post like an estimation*/
eret post B V
ereturn display
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
Elas1Step1 | 1.067076 4.756888 0.22 0.823 -8.256254 10.39041
Elas2Step1 | -.1161965 .4674547 -0.25 0.804 -1.032391 .7999978
ElasStep2 | 1.732858 1.548008 1.12 0.263 -1.301182 4.766897
------------------------------------------------------------------------------
/*Now, you can use nlcom to have your unconditionnal elasticities*/
/*for example:*/
nlcom (Unconditionnal_1 : _b[Elas1Step1] * _b[ ElasStep2] - _b[Elas2Step1])
Unconditio~1: _b[Elas1Step1] * _b[ ElasStep2] - _b[Elas2Step1]
-------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
--------------+----------------------------------------------------------------
Uncondition~1 | 1.965288 8.419876 0.23 0.815 -14.53737 18.46794
-------------------------------------------------------------------------------
Hope it helps you.
valérie
-------------------------------
Valérie OROZCO
Toulouse School of Economics (INRA-GREMAQ)
21, allée de Brienne
F-31000 Toulouse, France
MF 219
+33 5 61 12 85 91
-------------------------------
________________________________________
From
Aepli Matteo <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
st: How to calculate unconditional elasticites from different output files using nlcom
Date
Wed, 11 Sep 2013 14:52:15 +0000
________________________________________
Dear Stata Users
I have estimated several Quadratic Almost Ideal Demand System with Stata (multi-stage budgeting).
To get the elasticities I used the delta method (nlcom). I saved the results of nlcom. Due to the multi-stage budgeting the elasticities are conditional. To calculate unconditional elasticities I would have to use the calculated elasticities by nlcom from different files/different models. As suest does not support nlcom, I'm not able to combine these files and calculate unconditional elasticities using nlcom.
Does anybody has a solution?
I'm really appreciate your help!!
Best regards,
Matteo
*
* 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/