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: Internal model validation
From
Eduardo Nunez <[email protected]>
To
[email protected]
Subject
Re: st: Internal model validation
Date
Fri, 2 Apr 2010 14:45:38 -0400
Hi Maarten,
I did follow your advise, but what I get is an error.
Here is the code used:
*------------ begin example ----------------
use "C:\Users\USER\Documents\BNP_CA125.dta", clear
stcox edad fe40 nyhahigh tas_ingresoCE naCEi hbCEi
i.ca125categ_bnp100, efron nolog
matrix b = e(b)
capture program drop mysim
program define mysim, rclass
use "C:\Users\USER\Documents\BNP_CA125.dta", clear
bsample
estat concordance, beta(b)
return scalar Harrell=r(C)
end
simulate Harrell=r(C), reps(100): mysim
sum area
*-------------- end example ---------------
And this is the error reported:
. use "C:\Users\USER\Documents\BNP_CA125.dta", clear
. stcox edad fe40 nyhahigh tas_ingresoCE naCEi hbCEi
i.ca125categ_bnp100, efron nolog
failure _d: exitusev
analysis time _t: exitusev_days/365.25
id: pid
Cox regression -- Efron method for ties
No. of subjects = 293 Number of obs = 293
No. of failures = 91
Time at risk = 511.0171116
LR chi2(9) = 116.38
Log likelihood = -407.2559 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
_t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
edad | 1.035378 .0138991 2.59 0.010 1.008492 1.062982
fe40 | 1.871669 .4786707 2.45 0.014 1.133805 3.089726
nyhahigh | 1.696011 .3991827 2.24 0.025 1.069265 2.690124
tas_ingres~E | .982548 .0078511 -2.20 0.028 .96728 .998057
naCEi | .8740071 .0264654 -4.45 0.000 .823645 .9274486
hbCEi | .7615742 .0590108 -3.52 0.000 .6542695 .8864777
|
ca125cat~100 |
2 | 2.872742 1.18878 2.55 0.011 1.276609 6.464507
3 | 6.13319 2.511045 4.43 0.000 2.749086 13.6831
4 | 8.189165 3.506484 4.91 0.000 3.538077 18.95449
------------------------------------------------------------------------------
. matrix b = e(b)
.
. capture program drop mysim
. program define mysim, rclass
1. use "C:\Users\USER\Documents\BNP_CA125.dta", clear
2. bsample
3. estat concordance, beta(b)
4. return scalar Harrell=r(C)
5. end
.
. simulate Harrell=r(C), reps(100): mysim
last estimates not found
an error occurred when simulate executed mysim
r(301);
end of do-file
r(301);
What Am i doing wrong? I would appreciate your help.
Eduardo
On Thu, Apr 1, 2010 at 11:46 AM, Maarten buis <[email protected]> wrote:
> --- Eduardo Nunez asked:
>> I wonder if Stata (version 11) has a module to perform a Cox model
>> internal validation (mainly Harrell's C-statistics) using
>> bootstrapping?
>
> It is not pre-programmed, but it is not difficult to do in
> Stata. You can compute Harrel's C using -estat concordance-,
> see: -help stcox postestimation##estatcon-. You can do the
> bootstrap validation as in:
> http://www.stata.com/statalist/archive/2009-09/msg00180.html
>
> Hope this helps,
> Maarten
>
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
> http://www.maartenbuis.nl
> --------------------------
>
>
>
>
> *
> * 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/
>
*
* 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/