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]
Re: st: difficulty with aflogit command
From 
 
Richard Williams <[email protected]> 
To 
 
[email protected] 
Subject 
 
Re: st: difficulty with aflogit command 
Date 
 
Sun, 29 May 2011 10:12:39 -0500 
With user-written postestimation commands, you often need to run the 
estimation command under version control. This is because ereturned 
results can change across versions of Stata, and the post-estimation 
command was written for an older format. Also, it may be that aflogit 
doesn't like variable names that are more than 8 characters, which I 
am guessing was Stata's limit way back when. The following code seems to work:
sysuse auto, clear
version 10: logit foreign mpg rep78
aflogit
clonevar displace = displacement
poisson price weight displace
aflogit
At 12:54 AM 5/29/2011, Ari Samaranayaka wrote:
Hi
I am having difficulty with the user-written command aflogit.
Although it is expected to work after unconditional logit or poisson 
it does not work for me.
sysuse auto,clear
logit foreign mpg rep78
aflogit
this produce
Logistic regression                               Number of obs
=         69
                                                  LR chi2(2)
=      33.10
                                                  Prob > chi2     =
0.0000
Log likelihood = -25.851693                       Pseudo R2       =
0.3903
------------------------------------------------------------------------------
     foreign |      Coef.   Std. Err.      z    P>|z|     [95% 
Conf. Interval]
-------------+----------------------------------------------------------------
         mpg |   .1328672   .0735776     1.81   0.071    -.0113423
.2770767
       rep78 |    1.73607   .4928761     3.52   0.000     .7700508
2.70209
       _cons |  -10.03775   2.407455    -4.17   0.000    -14.75628
-5.319226
------------------------------------------------------------------------------
.
. aflogit
Can only be used after unconditional logistic or poisson regression
last estimates not found
r(301);
Then I used the following.
poisson price weight   displacement
aflogit
This produces
Poisson regression                                Number of obs
=         74
                                                  LR chi2(2)      =
29652.15
                                                  Prob > chi2     =
0.0000
Log likelihood = -29162.101                       Pseudo R2       =
0.3370
------------------------------------------------------------------------------
       price |      Coef.   Std. Err.      z    P>|z|     [95% 
Conf. Interval]
-------------+----------------------------------------------------------------
      weight |   .0003235   4.52e-06    71.55   0.000     .0003147
.0003324
displacement |   .0000446    .000037     1.20   0.228     -.000028
.0001172
       _cons |   7.708671   .0081077   950.79   0.000      7.69278
7.724561
------------------------------------------------------------------------------
. aflogit
Population attributable fraction from poisson regression
Cross-sectional / cohort data (n=74)
Term      Ref.     A.F.        s.e.      [95% Conf. Int.]*
----------------------------------------------------------
weight     0      0.6355     11.9561   -3.03e+27   1.0000
ment not found
r(111);
Can someone help me.
I am using stata SE 11.2.
my version of aflogit is
c:\ado\plus\a\aflogit.ado
*! version 1.0.6   16 Sep 1997  STB-42 sbe21
Thank you
Ari
*
*   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/
-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam
*
*   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/