Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: difficulty with aflogit command


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: difficulty with aflogit command
Date   Sun, 29 May 2011 10:34:52 +0100

The version of -aflogit- you are using is, as you report, from STB-42
in 1997 and I am not aware of a later version. My guess is that it is
broken by later changes in official Stata. Thus the first command set
you give does work in Stata 10.1, so my guess is that it is broken by
some change in Stata 11. The second command set does not work in 10.1
either. It looks like some bizarre side-effect of a change in Stata's
limits, so that "displacement" is being separated into "displace" and
"ment", but I haven't traced the error and I am not certain.

But -aflogit- is broken so far as you are concerned and I can offer no
solution for you except to find some other way of doing these
calculations.

Nick

On Sun, May 29, 2011 at 6:54 AM, Ari Samaranayaka <ari.s@xtra.co.nz> 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
>

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index