Dear all,
I am having problems figuring out how to calculate Harell's C-stat following stcox on imputed data.
I am using Stata version 14.2. I have tried to look at previous examples and posts on the same topic back to Oct 2014 (also tried to post my question here but didn't get an answer -therefore I am trying a new post).
I have tried the following code:
local model "score1plus"
mi estimate, hr saving(miest, replace): stcox `model'
local M=r(M)
scalar r2=0
scalar harrell_c=0
qui mi xeq 1/`M': stcox `model'; estat concordance; scalar harrell_c = r(C); scalar harrell=(r(n_E)+(r(n_T)/2))/r(n_P)
scalar r2=r2/`M'
scalar harrell_c=r(C)/`M'
scalar harrell=((r(n_E)+(r(n_T)/2))/r(n_P))/`M'
noi di "Pseudo R=squared over imputed data = " r2
noi di "C statistic over imputed data = " harrell_c
noi di "C statistic = " harrell
ereturn list
In the code above I get the same results from calculating "C-statistics over imputed data" and "C statistic" and with these calculations I get a C-stat of 0.0921. However, when I calculate C-statistics on non-imputed data I get a C-stat of 0.92. Not sure why?
Have any of you been succesful in calculating Harell's C-stat following multiple imputation using st cox? If so - which code have you used?
I would be very grateful for any input.
Related Posts with Harrell's C stat after multiple imputation
Enter all data from a dta file into a predefined Gantt diagram in StataHello everyone I really don't think the export excel command doesn't work very well when you have a…
Calculating weightHi, I have the attached file. I need to combine all three stocks into a single equal-weighted portf…
Cannot connect to SQL Database TableHello, I'm attempting to import data from a table in SQL Server into Stata. I've setup the connecti…
Dot plot mean by groupDear all, I want to create a dot plot that shows the mean of support for different policies by grou…
Threshold Regression in STATA 17Hi, I want to run the following regression: threshold inv, threshvar(lagtotaldebtofgdp) regionvars…
Subscribe to:
Post Comments (Atom)
0 Response to Harrell's C stat after multiple imputation
Post a Comment