The brewscheme toolkit for data visualization in Stata is almost ready for a stable version 1 release. All known bugs have been fixed and all of the planned features for version 1 have been implemented. More information can be found at the project page and source code repository.
A colleague recently asked me about a native solution in Stata to create a graph of the ROCs for multiple predictors (e.g., independent variables, covariates, right-hand side variables, etc…). I thought it might be helpful to provide a post to illustrate how to do this using data from the Strategic Data Project’s College Going Toolkit.
// Move into the directory where you've saved and unzipped the file from the site above
// Load dataset
use analysis/CG_Analysis.dta, clear
// Split Free/Reduced Lunch variable into separate indicator variables
qui: ta frpl_ever, gen(frl)
// Split Race/Ethnicity variable into separate indicator variables
qui: ta race_ethnicity, gen(race)
/* Estimate Sensitivity/Specificity for the predictors below and generate a graph showing the ROC curve */
roccomp ontime_grad frl2 frl3 race1 race2 race3 race4 race6, graph
// Save the graph generated by the command
gr export ../ROCexample.png, as(png) replace
New Stata programs are available from the website of the Executive Director of PACES William R. Buchanan . The first package -email- is still in the early stages of development and allows users to send email directly from Stata. This is particularly useful if you need to perform many operations, such as creating graphs, which … [Read more…]