A SAS User's Guide to
Stata
This guide is intended to introduce a SAS user to Stata and to be a
cheat sheet when writing Stata code. There is a
Stata
tutorial to help any new user learn Stata. It is
referred to on occasion throughout these pages.
Tools to transfer data between SAS and Stata:
-
SAVASTATA: SAS macro to save a SAS dataset as a Stata
dataset.
- SAVASAS:
Stata program to save a Stata dataset as a SAS dataset.
- USESAS:
Stata program to use a SAS dataset while in Stata.
-
SAVAS (c-shell) script: Invoked at a UNIX/Linux prompt
makes Stata data file copies of SAS data files or SAS data file copies
of Stata data files.
Papers to presented at the Southeastern SAS Users Group conference (SESUG) in Nashville November 2004:
SAS macros inspired by Stata commands:
-
MINIME : SAS macro to reset variable lengths to a safe minimum storage length like Stata's -compress-.
- REN_STEM : SAS macro to rename variables by adding a prefix or suffix which Stata can do in a -foreach- loop.
- CHAR2FMT
: SAS macro to convert character variables to numeric but keep the
character information stored in a SAS format like Stata's -encode-.
Questions or comments? If you are affiliated to the Carolina Population Center, send them to
Phil Bardsley; non-affiliates may contact the author
Dan Blanchette.