Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: statalist-digest V4 #3858


From   Dan Blanchette <dan.blanchette@duke.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Re: statalist-digest V4 #3858
Date   Fri, 23 Jul 2010 10:54:14 -0400 (EDT)

BTW, -usesas- requires that you also have SAS installed on the same
computer because it invokes SAS to load a SAS dataset into Stata.

-usesas- can run a SAS program to load the last dataset created by
the SAS program.  So you can download the SAS dataset and create a
SAS program like so:

**************************************************;

 libname in "C:\data";

 proc format;
   ...copy and paste all the formats code here...
 run;

 data work.naaccr_cina_2002_2006_sas_data;
  set in.naaccr_cina_2002_2006_sas_data;

  format reg regf.
         race racef.
         site sitef.
         sex sexf.
         age agef.
         pedsite pedsitef.
         combined combinef.
         nhiacomb nhiacf.
         adltincd pedincd yn.
  ;;

run;
**************************************************;

and save it to:
  C:\data\cina.sas
and invoke -usesas- like so:

  usesas using "C:\data\cina.sas"

My Stata command -saswrapper- is designed specifically to run SAS code from within Stata and could also run your SAS program like so:

  saswrapper using "C:\data\cina.sas", nodata usesas

The "nodata" option means "do not transfer the dataset currently in Stata to SAS". -saswrapper- does that by default assuming you want to run some SAS code on the Stata dataset in memory. The -usesas- option loads the last dataset created in the SAS program back to Stata.

HTH,
Dan Blanchette
Research Associate
Center for Entrepreneurship and Innovation
Duke University's Fuqua School of Business
dan.blanchette@duke.edu

Date: Thu, 22 Jul 2010 08:51:56 -0400
From: Marcello Pagano <pagano@hsph.harvard.edu>
Subject: Re: st: CINA

Thanks, Steve, we'll try them.

m.p.

On 7/22/2010 8:14 AM, Steven Samuels wrote:
StatTransfer or Don Blanchette's -usesas- should convert the SAS data
files.
(http://faculty.fuqua.duke.edu/home/blanc004/data_programming/sas_to_stata/usesas.html)
To convert the VALUE statments, PERL code at
http://grafodexia.blogspot.com/2009/04/perl-code-to-convert-sas-code-to-stata.html
might help. I've not used the last two.


Steve

On Jul 22, 2010, at 6:29 AM, Marcello Pagano wrote:

Dear Listers,

Has anyone translated (parts) of this into Stata?

http://www.naaccr.org/Research/CINAMonoInSAS.aspx

m.p.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index