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
Convolutions of two WTP empirical distributionsDear statalist, Have anyone coded a covolution to evaluate equality of empirical WTP distributions?…
by()-option in twoway graphs: Getting rid of the boc around the titleDear Statalisters, I have a rather simple question about formatting graphs, but I couldn'f figure i…
Export either table or tabdisp as latex fileI am using: gen ycc_table=. replace ycc_table=year if evnt3w==1 by country ( ycc_table ), sort: …
Survival analysisDear all, I'm restructuring my historical datasets to perform survival analysis. My data is in a non…
how to calculate the experience diversity of panels?Every expert panel has about 5 experts, every expert has different experience such as service, R&…
Subscribe to:
Post Comments (Atom)
0 Response to Multiple imputation STATA command
Post a Comment