Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Saving QUAIDS elasticites as separate variables

    Hi Statalisters

    I am trying to save the elasticities that are generated by Brian Poi (2012) "quaids" command as separate variables.

    To be specific, I want the elasticites in the price elasticities matrix to be saved as unique variables such as row 1, column 1 elasticity as one variable and row 1 column 2 as another variable etc.

    Saving the variables in the following way, gives me unique columns only so that I have 4 separate variables (col1 col2 col3 and col4) but not 16 separate variables which I want.
    Any suggestions?

    Thank you in advance

    Mariko Wijekoon


    clear
    webuse food
    quaids w1-w4, anot(10) lnprices(lnp1-lnp4) expenditure(expfd)
    *Calculate observation-level predicted expenditure shares and elasticities
    predict what*
    estat expenditure mu*
    estat compensated ce*
    estat uncompensated ue*
    *Calculate elasticities and standard errors at variable means
    estat expenditure, atmeans
    matrix list r(expelas)
    mat expend=r(expelas)
    svmat double expend, names(matcol)
    *
    estat compensated, atmeans
    matrix list r(compelas)
    mat pricec =r(compelas)
    svmat double pricec, names(matcol)
    *
    estat uncompensated, atmeans
    matrix list r(uncompelas)
    mat u =r(uncompelas)
    svmat double u, names(matcol)

  • #2
    What about

    Code:
    estat compensated, atmeans
    mat pricec =r(compelas)
    mat pricecv=vec(pricec)'
    svmat double pricecv
    Jorge Eduardo Pérez Pérez
    www.jorgeperezperez.com

    Comment


    • #3
      It worked! Thank you very much Jorge!!!

      Mariko Wijekoon

      Comment


      • #4
        Dear Mariko,
        I am trying to estimate a censored demand system using quaids and was wondering if you could share the program codes you used with any supporting documentation. I understand it worked for you after some debugging and would appreciate your assistance.
        Arega

        Comment


        • #5
          A small tip is that you can look at people's profiles to see when they were last active. In this case Mariko was last active on 05 Nov 2014, so a personal response would probably require writing directly, although there is no guarantee that people's email addresses are identifiable.

          Naturally, the thread remains visible to those interested by the title.

          Comment

          Working...
          X