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 |
"Brian P. Poi" <brian@poiholdings.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: SUREG for Almost Ideal Demand System |

Date |
Sat, 02 Jul 2011 18:55:25 -0400 |

On 07/01/2011 08:37 PM, Michael Musyoka wrote:

Thanks a lot Poi for the assistance. Indeed I have managed it directly with the coefficients from Sureg. But once I extract the coefficients into a matrix, I am not getting the se and variance covariance matrix. Is there a way to combine nlcom with matrix of coefficients? this will make it possible to do the own and cross elasticities by stating i=j or i>j and vice versa at once.... For example...say Matrix E...Expenditure coefficient in Sureg....then matrix list E matrix c=J(13,1,1) matrix Expel=J(13,1,0) matrix n=J(13,1,0) forval i=1/13 { forval j=1/1 { mat Expel[`i',`j']=c[`i',`j']+(scd[`i',`j']*E[`i',`j'])/sw[`i',`j'] nlcom (shares:c[`i',`j']+(0.33450538*E[`i',`j'])/.14810108) } }

// Get the means of the w's summ w1, meanonly scalar w1_mean = r(mean) summ w2, meanonly scalar w2_mean = r(mean) summ w3, meanonly scalar w3_mean = r(mean) summ w4, meanonly scalar w4_mean = r(mean) nlcom (1 + _b[/b1]/w1_mean) /// (1 + _b[/b2]/w2_mean) /// (1 + _b[/b3]/w3_mean) /// (1 + (-_b[/b1] - _b[/b2] - _b[/b3])/w4_mean) mat eta = r(b) mat etaV = r(V) // Let's verify Engel aggregation to check our results mat ws = (w1_mean, w2_mean, w3_mean, w4_mean) mat result = eta*ws' mat list result // Here is the complete covariance matrix: mat list etaV

I hope this helps. -- Brian Poi -- brian@poiholdings.com * * 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/

**Follow-Ups**:**Re: st: SUREG for Almost Ideal Demand System***From:*Michael Musyoka <pmusyokastata@yahoo.com>

**References**:**Re: st: SUREG for Almost Ideal Demand System***From:*Michael Musyoka <pmusyokastata@yahoo.com>

- Prev by Date:
**st: interpreting coefficients in glm** - Next by Date:
**st: PCA with Missing Values (or other factor analysis)** - Previous by thread:
**Re: st: SUREG for Almost Ideal Demand System** - Next by thread:
**Re: st: SUREG for Almost Ideal Demand System** - Index(es):