Announcement

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

  • Transforming random-effects parameters of an xtmixed model with two levels

    Hi,
    I have a two Level xtmixed model I can't transform properly the random-effects Parameters to get them as standard deviations in esttab.

    This is my model:
    xtmixed logrealpricehl realmonthly_av_price_must_hl prov_wine_elaborated_10000hl percentage_change_must_2011_02 av_hl_prodcoopiofs2 red ownbrand coop_buyer swshare_of_producers, || region: ||cod_dept_buyer: , mle

    I wrote:
    esttab reg1 using regwine_shares156633.rtf, star(* 0.10 ** 0.05 *** 0.01) r2 ar2 onecell nogaps scalars("F" "chi2_c") wide transform(ln*: exp(@) exp(@)) eqlabels("" "sd(_cons)" "sd(_cons)" "sd(Residual)", none) varlabels(,elist(region:_cons "{break}{hline @width}")) varwidth(13) replace b(%10.4f) se
    But I don’t get all the standard deviations. I think I have a problem addressing the two levels.
    Anyone has some advice about it?
    Best,
    Agustina






  • #2
    Here is an example obtaining the standard deviation of the the random effects in esttab (written by Ben Jann, SJ14-2 Making regression tables from stored estimates, findit esttab to locate and download).

    Code:
    . webuse productivity
    (Public Capital Productivity)
    
    . eststo: mixed gsp private emp hwy water other unemp || region: || state: , stddev noheader nogroup nofet nolog
    
    ------------------------------------------------------------------------------
      Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
    -----------------------------+------------------------------------------------
    region: Identity             |
                       sd(_cons) |    .038087   .0170591      .0158316     .091628
    -----------------------------+------------------------------------------------
    state: Identity              |
                       sd(_cons) |   .0792193   .0093861      .0628027    .0999273
    -----------------------------+------------------------------------------------
                    sd(Residual) |   .0366893    .000939      .0348944    .0385766
    ------------------------------------------------------------------------------
    LR test vs. linear model: chi2(2) = 1154.73               Prob > chi2 = 0.0000
    
    Note: LR test is conservative and provided only for reference.
    (est1 stored)
    
    .  esttab, onecell nogaps not  transform(ln*: exp(@) exp(@))
    
    ----------------------------
                          (1)   
                          gsp   
    ----------------------------
    gsp                         
    private             0.267***
    emp                 0.754***
    hwy                0.0710** 
    water              0.0761***
    other             -0.1000***
    unemp            -0.00590***
    _cons               2.129***
    ----------------------------
    lns1_1_1                    
    _cons              0.0381***
    ----------------------------
    lns2_1_1                    
    _cons              0.0792***
    ----------------------------
    lnsig_e                     
    _cons              0.0367***
    ----------------------------
    N                     816   
    ----------------------------
    * p<0.05, ** p<0.01, *** p<0.001

    Comment


    • #3
      Hi,
      I am having a problem transforming the unstructured covariance from xtmixed. The code works when I transform the rest of the variance components, but not when I also transform the covariance.

      esttab model1 model2, mtitles("Model 1" "Model 2") ///
      se transform(ln at : exp(@)^2 exp(@)^2 exp(@)^2 exp(@)*exp([lns1_1_1]_b[_cons])*exp([lns1_1_2]_b[_cons]) )

      Thanks for your help!

      Comment


      • #4
        You can find here some examples for esttab with mixed command. I will replicate Scott's example.

        Code:
        .  est clear
        
        .  eststo: mixed gsp private emp hwy water other unemp || region: || state: hwy,cov(uns) stddev noheader nogroup nofet nolog   
        
        ------------------------------------------------------------------------------
          Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
        -----------------------------+------------------------------------------------
        region: Identity             |
                           sd(_cons) |    .027124   .0831532      .0000667    11.03705
        -----------------------------+------------------------------------------------
        state: Unstructured          |
                             sd(hwy) |   .2771839   .0407205      .2078356    .3696716
                           sd(_cons) |   2.558362   .3679016      1.929995    3.391312
                     corr(hwy,_cons) |  -.9984721   .0007565     -.9994212   -.9959698
        -----------------------------+------------------------------------------------
                        sd(Residual) |   .0302653   .0008933      .0285641    .0320678
        ------------------------------------------------------------------------------
        LR test vs. linear regression:       chi2(4) =  1294.89   Prob > chi2 = 0.0000
        
        Note: LR test is conservative and provided only for reference.
        (est1 stored)
        
        .  esttab, onecell nogaps not transform(ln*: exp(@) exp(@) at*: tanh(@) (1-tanh(@)^2))
        
        ----------------------------
                              (1)   
                              gsp   
        ----------------------------
        gsp                         
        private             0.180***
        emp                 0.858***
        hwy                0.0514   
        water              0.0715***
        other             -0.0810***
        unemp            -0.00449***
        _cons               2.359***
        ----------------------------
        lns1_1_1                    
        _cons              0.0271   
        ----------------------------
        lns2_1_1                    
        _cons               0.277***
        ----------------------------
        lns2_1_2                    
        _cons               2.558***
        ----------------------------
        atr2_1_1_2                  
        _cons              -0.998***
        ----------------------------
        lnsig_e                     
        _cons              0.0303***
        ----------------------------
        N                     816   
        ----------------------------
        * p<0.05, ** p<0.01, *** p<0.001

        Comment

        Working...
        X