Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: strange -storecmd- behavior


From   "FEIVESON, ALAN H. (AL) (JSC-SK311) (NASA)" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: strange -storecmd- behavior
Date   Wed, 7 Dec 2005 12:52:33 -0600

Nick I was using -storecmd- to do -xtintreg- but I obtained slightly
different results after the -storecmd- statement and then if I repeat the
analysis with a straight command. For some reason, with "storecmd", the
integration method used is 
"ghermite" (not the default), whereas with the straight command, it
correctly uses the default "aghermite". But I never issued an option for
"ghermite" so what's going on?

Al

. storecmd INTREG8 xtintreg zmiss z ind2 ind3 ind4 if icyt==8 ,i(jsub) nolog

Random-effects interval regression              Number of obs      =
97
Group variable (i): jsub                        Number of groups   =
28

Random effects u_i ~ Gaussian                   Obs per group: min =
3
                                                               avg =
3.5
                                                               max =
4

                                                Wald chi2(3)       =
9.37
Log likelihood  = -98.397601                    Prob > chi2        =
0.0248

----------------------------------------------------------------------------
--
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
        ind2 |   .2779403   .1801249     1.54   0.123     -.075098
.6309787
        ind3 |   .4799128   .1793074     2.68   0.007     .1284768
.8313488
        ind4 |   .0490643   .1817517     0.27   0.787    -.3071625
.4052911
       _cons |    1.64652   .1439518    11.44   0.000      1.36438
1.92866
-------------+--------------------------------------------------------------
--
    /sigma_u |   .5890853   .0847491     6.95   0.000     .4229802
.7551905
    /sigma_e |   .5086366   .0529546     9.61   0.000     .4048475
.6124256
-------------+--------------------------------------------------------------
--
         rho |   .5728955   .0834249                      .4078475
.7259425
----------------------------------------------------------------------------
--

. ereturn list

scalars:
                e(ll) =  -98.39760067570394
              e(df_m) =  3
              e(chi2) =  9.367763093475308
            e(n_quad) =  12
               e(N_g) =  28
             e(g_min) =  3
             e(g_avg) =  3.464285714285714
             e(g_max) =  4
             e(N_unc) =  78
              e(N_lc) =  19
              e(N_rc) =  0
             e(N_int) =  0
                 e(N) =  97
            e(chi2_c) =  48.31552213790093
           e(sigma_u) =  .5890853482329951
           e(sigma_e) =  .5086365726862585
               e(rho) =  .5728955056304219

macros:
               e(cmd) : "xtintreg"
              e(ivar) : "jsub"
           e(predict) : "tobit_p"
            e(depvar) : "zmiss z"
           e(chi2_ct) : "Wald"
        e(properties) : "b V"
             e(title) : "Random-effects interval regression"
           e(distrib) : "Gaussian"
         e(intmethod) : "ghermite"
          e(crittype) : "log likelihood"
          e(chi2type) : "Wald"

matrices:
                 e(b) :  1 x 6
                 e(V) :  6 x 6

functions:
            e(sample)   

. 








. xtintreg zmiss z ind2 ind3 ind4 if icyt==8 ,i(jsub) nolog

Random-effects interval regression              Number of obs      =
97
Group variable (i): jsub                        Number of groups   =
28

Random effects u_i ~ Gaussian                   Obs per group: min =
3
                                                               avg =
3.5
                                                               max =
4

                                                Wald chi2(3)       =
9.25
Log likelihood  = -98.427307                    Prob > chi2        =
0.0261

----------------------------------------------------------------------------
--
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
        ind2 |   .2834601   .1838606     1.54   0.123       -.0769
.6438203
        ind3 |   .4859499   .1829623     2.66   0.008     .1273503
.8445495
        ind4 |   .0547933   .1856597     0.30   0.768    -.3090932
.4186797
       _cons |   1.663773   .1530167    10.87   0.000     1.363866
1.96368
-------------+--------------------------------------------------------------
--
    /sigma_u |   .6051366   .0952469     6.35   0.000     .4184562
.7918171
    /sigma_e |    .513304   .0509305    10.08   0.000     .4134821
.6131259
-------------+--------------------------------------------------------------
--
         rho |   .5815579   .0908475                      .4012919
.7459393
----------------------------------------------------------------------------
--

  Observation summary:        19  left-censored observations
                              78     uncensored observations
                               0 right-censored observations
                               0       interval observations



. ereturn list

scalars:
                e(rc) =  0
                e(ll) =  -98.42730712890625
         e(converged) =  1
              e(rank) =  6
                 e(k) =  6
              e(k_eq) =  3
              e(k_dv) =  2
                e(ic) =  4
              e(df_m) =  3
              e(chi2) =  9.249642461173721
                 e(p) =  .0261494544480191
            e(n_quad) =  12
               e(N_g) =  28
             e(g_min) =  3
             e(g_avg) =  3.464285714285714
             e(g_max) =  4
             e(N_unc) =  78
              e(N_lc) =  19
              e(N_rc) =  0
                 e(N) =  97
               e(rho) =  .5815578938064966
           e(sigma_e) =  .5133039972278113
           e(sigma_u) =  .605136618421632
            e(chi2_c) =  40.36503330986928
             e(N_int) =  0

macros:
               e(cmd) : "xtintreg"
              e(ivar) : "jsub"
           e(predict) : "xtintreg_p"
            e(depvar) : "zmiss z"
           e(chi2_ct) : "Wald"
        e(properties) : "b V"
             e(title) : "Random-effects interval regression"
           e(distrib) : "Gaussian"
         e(intmethod) : "aghermite"
          e(chi2type) : "Wald"
               e(opt) : "ml"
         e(ml_method) : "d2"
              e(user) : "xtintreg_d2"
          e(crittype) : "log likelihood"
         e(technique) : "nr"

matrices:
                 e(b) :  1 x 6
                 e(V) :  6 x 6
          e(gradient) :  1 x 6
              e(ilog) :  1 x 20

functions:
            e(sample)   

. 














. which storecmd
.\storecmd.ado
*! 1.0.0 NJC 8 December 1999 with code from Jeroen Weesie's -keyb- 

program storecmd 
*! 1.0.0 NJC 8 December 1999 with code from Jeroen Weesie's -keyb- 
        version 7.0
	gettoken cname 0 : 0 
        if `"`0'"' == "" {
             error 198
             }
        
        if `"$BUF_DISP"' != "" {
             di in wh `". `0'"'
             }

	local cmd `"`0'"' 
	
	* put command in keyboard buffer 
        push `cmd' 
  
	* execute command 
        `cmd'
	
	* save to characteristic if it worked 
	char _dta[`cname'] `"`cmd'"' 
end
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index