Below is the command I am using to calculate the AUC for my prediction models in imputed datasets.
I am searching for a STATA command similar to "roctab: depvar p, detail" for imputed datasets.
Any suggestions for STATA command to calculate the sensitivity and specificity (at different cut-offs) for imputed datasets?
cap program drop eroctab
program eroctab, eclass properties(mi)
version 12.0
args refvar
capture drop p
logistic `refvar' x1 x2 x3
predict p
roctab `refvar' p
tempname b V
mat `b' = r(area)
mat `V' = r(se)^2
local N = r(N)
mat colnames `b' = AUC
mat colnames `V' = AUC
mat rownames `V' = AUC
ereturn post `b' `V', obs(`N')
ereturn local cmd "eroctab"
ereturn local title "ROC area"
end
mi estimate, cmdok: eroctab refvar
Thank you!!!
Related Posts with Multiple imputation STATA command
prediction, unexpected resultsHi, I run a prediction by the first 20 sample (y and x), and I would like to use the results to pre…
Loop for many, same regressions with similar namesHello everyone, I am new to Stata and need your help. I can run the following simple regression with…
Can mecloglog be used for multi-failure outcomes in discrete-time survival analysis?Hello everyone, I'm running a data analysis to evaluate the association between a time-varying predi…
multilevel model with dependent ordinal value(Likert scale) and longitudinal dataHello everyone, i am handling the data with Likert scale(Survey data) and i have to use multilevel …
miest could not be openedDear Stata team, I'm trying to save miest file but i get the following error: [mi estimate,saving …
Subscribe to:
Post Comments (Atom)
0 Response to Multiple imputation STATA command
Post a Comment