Giter VIP home page Giter VIP logo

generic-sas-macros's Introduction

Place holder for Repository Name

This repository was created for use by CDC programs to collaborate on public health surveillance related projects in support of the CDC Surveillance Strategy. Github is not hosted by the CDC, but is used by CDC and its partners to share information and collaborate on software.

Generic SAS macros for creating publication-quality tables

This repository contains a series of generic SAS macros for creating publication-quality tables. The final formatted output is exported into MS Word or Excel and can be incorporated directly into a manuscript or might require minimal edits to match journal specific publication requirements. They have been design to analysis data from both survey and non-survey settings. The macros have being developed to run on windows platform and might require appropriate adjustments to run on other operating systems platforms

1. %metadata macro

This is a SAS macro that generates metadata and data dictionaries for analysis datasets. It is very useful in performing data review to obtain such data metrics as the number of records, number of variables, and variables with missing values. It produces a publication-quality table displaying the variable name, variable description, data type, and summary statistics. For continuous variables it shows the total number of responses. If missing data are available the n column shows number of non-missing responses and the % column will show proportion of completeness. For categorical variables it shows the distribution of responses for each category including missing data.

A sample macro call program, "metadata analysis file.sas", is also provided as part of this repository.

2. %svy_freq macro

This is a generic SAS macro for creating publication ready table of cross-tabulation between a factor and a by group variable given a third variable using survey/non-survey data. It also recodes factor variables with character values to numeric values. Depending on the user specification, the macro outputs Col% or Row% or Prevalence% and corresponding 95% confidence intervals for categorical variable. It also outputs Means (95% CI) or Median (IQR) for continous variables.

The macro is made up of several auxiliary sub-macros. The %svy_col sub-macro perform crosstabulation between a factorand by a group variable and output COL%. The %svy_row sub-macro performs crosstabulation between a factor and by a group variable and output ROW%. The %svy_prev sub-macro performs crosstabulation between a factor and by a group variable given a third variable and output (PREVALENCE%). The %svy_median sub-macro performs MEDIAN statistics for a continuous variable and a by group variable. The %svy_mean sub-macro performs MEAN statistics for a continuous variable and a by group variable. The %charvar sub-macro to recode variables with character values to numeric values whereas then %distcolval sub-macro is used to produce one instance of repeated values. The %runquit sub-macro enforces in-built SAS validation checks on input parameters.

A sample macro call program, "svy_freqs analysis file.sas", is also provided as part of this repository.

A manuscript describing more about the macro contents and usage is available online at: https://www.biorxiv.org/content/10.1101/771303v1

3. %svy_logistic_regression macro

This is a generic SAS macro for creating publication-quality tables from simple and multiple logistic regression models. The macro uses both survey or non-survey data. It outputs a quality-publication table of Odds Ratio (95% CI) from simple (bi-variate) and multiple (multivariable) logistic regression in MS Word and Excel results.

The macro is made up of several auxiliary sub-macros. The %svy_logitc sub-macro performs simple (bivariate) logistic regression model on categorical predictors. The %svy_logitn sub-macro performs simple (bivariate) logistic regression model on continuous predictors. The %svy_multilogit sub-macro performs multiple (multivariable) logistic regression on selected predictors. The %svy_printlogit sub-macro combines results from simple (bivariate) and multiple (multivariable) logistic regression and packages the output in a publication-quality table which is exported to MS Word and Excel. The %runquit sub-macro enforces in-built SAS validation checks on input parameters.

A sample macro call program, "svy logistic regression anafile.sas", is also provided as part of this repository.

A manuscript describing more about the macro contents and usage is available online at: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0214262

Public Domain

This repository constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. This repository is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication. All contributions to this repository will be released under the CC0 dedication. By submitting a pull request you are agreeing to comply with this waiver of copyright interest.

License

The repository utilizes code licensed under the terms of the Apache Software License and therefore is licensed under ASL v2 or later.

This source code in this repository is free: you can redistribute it and/or modify it under the terms of the Apache Software License version 2, or (at your option) any later version.

This source code in this repository is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache Software License for more details.

You should have received a copy of the Apache Software License along with this program. If not, see http://www.apache.org/licenses/LICENSE-2.0.html

The source code forked from other open source projects will inherit its license.

Privacy

This repository contains only non-sensitive, publicly available data and information. All material and community participation is covered by the Surveillance Platform Disclaimer and Code of Conduct. For more information about CDC's privacy policy, please visit http://www.cdc.gov/privacy.html.

Contributing

Anyone is encouraged to contribute to the repository by forking and submitting a pull request. (If you are new to GitHub, you might start with a basic tutorial.) By contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users under the terms of the Apache Software License v2 or later.

All comments, messages, pull requests, and other submissions received through CDC including this GitHub page are subject to the Presidential Records Act and may be archived. Learn more at http://www.cdc.gov/other/privacy.html.

Records

This repository is not a source of government records, but is a copy to increase collaboration and collaborative potential. All government records will be published through the CDC web site.

Notices

Please refer to CDC's Template Repository for more information about contributing to this repository, public domain notices and disclaimers, and code of conduct.

----- for use in template only -----

Hat-tips

Thanks to 18F's open source policy and code of conduct that were very useful in setting up this GitHub organization. Thanks to CDC's Informatics Innovation Unit that was helpful in modeling the code of conduct.

----- for use in template only -----

generic-sas-macros's People

Contributors

kmuthusi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.