Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: about AIC

From   Steven Samuels <>
Subject   Re: st: about AIC
Date   Thu, 16 Jun 2011 15:04:37 -0400

I meant "at most one failure per person"  not "at most one failure"


Thanks, Joerg

I completely overlooked the fact the Yusvita wanted the AIC for the null model.

I prefer BIC for model comparison.  Volinsky and Rafferty (2000) found better prediction in survival models for a version of BIC that uses the number of failures (or "risk pools"), rather than the number of observations. This number is unambiguously defined for single or multiple-record data, provided there is at most one failure. For other situations, the definition of "number of failures" that should enter the formula is, to me, cloudier. See the -help- for "bic_note" for related issues.

sysuse cancer, clear
stcox age drug
scalar bic_r = -2*e(ll) + log(e(N_fail))*e(rank) 
scalar bic_n = -2*e(ll) + log(e(N))*e(rank)
di "BIC-sample  count: " bic_n    _newline "BIC-failure count: " bic_r
estat ic

Ref: Volinsky CT, Raftery AE. Bayesian information criterion for censored survival models. Biometrics. 2000;56:256–262.


On Jun 16, 2011, at 10:41 AM, Joerg Luedicke wrote:

On Thu, Jun 16, 2011 at 1:32 AM, Yusvita Triwiadhian S.
<> wrote:
> dear all,
> i want to fit the model for survival analysis using AIC. How to get
> AIC for Cox proportional? because when I run -stcox- without
> independent variable, then i type -estat ic-
> it appears an error "last estimates not found".
> How to solve it?

Do you get the error message "last estimates not found" after -estat
ic- or after -stcox-? You will get this message if you just typed
-stcox- in order to fit a null model. If you do that, Stata thinks you
wanted to replay the current model in memory which it does not find
then. To fit a null model, type -stcox, estimate-. The -estat ic-
command should run without error message anyhow so I assume you do not
get that error message after -estat ic-. In any case, the AIC can
easily be calculated by hand: It is -2 times the log likelihood plus 2
times the number of parameters in the model. For example after running
stcox with covariates you could type:

di -2*e(ll)+2*e(rank)

Without covariates it is just -2 times the log likelihood:

di -2*e(ll)

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index