Announcement

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

  • collect layout + Correlated random-effects regression

    Hi,

    based on the following example, my understanding is that CRE _r_b and _r_se should be reported allined with other estimators, as they are fully comparable.

    Code:
    use http://fmwww.bc.edu/ec-p/data/greene2000/TBL15-1.dta,clear
    xtset firm year
    xtdes
    vl clear
    vl create depVar = (i)
    vl create vlcont = (f c)
    xtreg i f c,fe
    estimate store fe
    xtreg i f c,re
    estimate store re
    xtreg i f c,cre
    estimate store cre
    collect clear
    collect create output
    collect set output
    qui etable, estimates(re fe cre ) cstat(_r_b,nformat(%3.2f)) showstars showstarsnote name(output, replace)
    collect label levels etable_depvar 1 "re" 2 "fe" 3 "cre", modify
    collect style cell result[_r_b] , nformat("%3.1f")
    collect layout (coleq#colname#result[_r_b _r_se] result[N]) (etable_depvar#stars) (), name(output)
    
    Collection: output
          Rows: coleq#colname#result[_r_b _r_se] result[N]
       Columns: etable_depvar#stars
       Table 1: 17 x 6
    
    ----------------------------------------------------------
                                re          fe         cre    
    ----------------------------------------------------------
    f                           0.1 **      0.1 **            
                            (0.015)     (0.016)               
    c                           0.3 **      0.3 **            
                            (0.024)     (0.024)               
    Intercept                 -60.3       -62.6 *             
                           (54.484)    (29.442)               
    f                                                   0.1 **
                                                    (0.016)   
    c                                                   0.3 **
                                                    (0.024)   
    Intercept                                          -2.1   
                                                   (86.732)   
    f                                                   0.3   
                                                    (0.164)   
    c                                                  -1.9   
                                                    (1.067)   
    Number of observations      100         100         100   
    ----------------------------------------------------------
    ** p<.01, * p<.05
    LP

  • #2
    Thank you for the working example.

    If you add option showeq in your call to etable, you will see that xtreg, cre uses a different name for the first equation. You can change that equation name to match the other two estimates with option eqrecode(xit_vars=i).

    See my changes to your code, in blue.
    Code:
    use http://fmwww.bc.edu/ec-p/data/greene2000/TBL15-1.dta,clear
    xtset firm year
    xtdes
    vl clear
    vl create depVar = (i)
    vl create vlcont = (f c)
    xtreg i f c,fe
    estimate store fe
    xtreg i f c,re
    estimate store re
    xtreg i f c,cre
    estimate store cre
    collect clear
    collect create output
    collect set output
    qui etable, ///
        estimates(re fe cre ) ///
        cstat(_r_b,nformat(%3.2f)) ///
        showstars ///
        showstarsnote ///
        name(output, replace) ///
        eqrecode(xit_vars=i)
    collect label levels etable_depvar 1 "re" 2 "fe" 3 "cre", modify
    collect style cell result[_r_b] , nformat("%3.1f")
    collect layout (coleq#colname#result[_r_b _r_se] result[N]) (etable_depvar#stars) (), name(output)
    Here is the resulting table.
    Code:
    ----------------------------------------------------------
                                re          fe         cre    
    ----------------------------------------------------------
    f                           0.1 **      0.1 **      0.1 **
                            (0.015)     (0.016)     (0.016)   
    c                           0.3 **      0.3 **      0.3 **
                            (0.024)     (0.024)     (0.024)   
    Intercept                 -60.3       -62.6 *      -2.1   
                           (54.484)    (29.442)    (86.732)   
    f                                                   0.3   
                                                    (0.164)   
    c                                                  -1.9   
                                                    (1.067)   
    Number of observations      100         100         100   
    ----------------------------------------------------------

    Comment

    Working...
    X