Hello Statalisters,
Me and my colleagues are running several regression models on patient data in order to estimate health outcomes and resource consumption. Regression commands include (but not necessarily limited to): regress, logit, nbreg and glm, family(gamma). Each model has up to 20 covariates, and the patients are sometimes divided into named subgroups. Regressions are either done for all patients or for each subgroup separately. Now to the problem: I want to be able to export the output from the regressions to some standard format (preferably .csv or similar) which contains all relevant data in order to predict the outcomes. Relevant data includes: Regression coefficients, regression model (actually the formula for prediction) and subgroup for which this regression is done over. Also of interest is the number of data points in each regression and the mean of the dependent variable in each regression, and maybe the data type of each covariate and dependent variable, but these are not as neccessary. Basically, the export file should contain all data to assemble a prediction model in e.g. excel without any extra data added.
My idea has so far been to use eststo to store the result from each regression, estadd to somehow manually add the metadata needed to named e() macros or scalars and estout to actually write the export file, all from SSC. Maybe I will write wrapper functions for these ones with predefined options for the commands.
Many thanks for suggestions on how to do this!
Me and my colleagues are running several regression models on patient data in order to estimate health outcomes and resource consumption. Regression commands include (but not necessarily limited to): regress, logit, nbreg and glm, family(gamma). Each model has up to 20 covariates, and the patients are sometimes divided into named subgroups. Regressions are either done for all patients or for each subgroup separately. Now to the problem: I want to be able to export the output from the regressions to some standard format (preferably .csv or similar) which contains all relevant data in order to predict the outcomes. Relevant data includes: Regression coefficients, regression model (actually the formula for prediction) and subgroup for which this regression is done over. Also of interest is the number of data points in each regression and the mean of the dependent variable in each regression, and maybe the data type of each covariate and dependent variable, but these are not as neccessary. Basically, the export file should contain all data to assemble a prediction model in e.g. excel without any extra data added.
My idea has so far been to use eststo to store the result from each regression, estadd to somehow manually add the metadata needed to named e() macros or scalars and estout to actually write the export file, all from SSC. Maybe I will write wrapper functions for these ones with predefined options for the commands.
Many thanks for suggestions on how to do this!
Comment