Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: STATA equivalent SAS code
From
Dan Blanchette <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: RE: STATA equivalent SAS code
Date
Fri, 9 Jul 2010 10:17:57 -0400 (EDT)
Jose,
I hope you know about my webpage:
"A SAS User's Guide to Stata"
http://faculty.fuqua.duke.edu/home/blanc004/data_programming/sas_to_stata/
Martin is right that Stata's -inlist()- is equivalent to SAS's in().
In Stata's -inlist()- you have to put the variable being tested inside the
parentheses which is not how SAS's in() works:
if varx in (value1,value2,value3) then ...some SAS code ...;
would be:
..some Stata code... if inlist(varx,value1,value2,value3)
There is not really a Stata equivalent to SAS's if-then-do programming style,
but I have an example Stata do-file page that shows how you can come pretty
close to doing that sort of programming in Stata:
http://faculty.fuqua.duke.edu/home/blanc004/data_programming/stata/code/cond_fun.html
HTH,
Dan Blanchette
Research Associate
Center for Entrepreneurship and Innovation
Duke University's Fuqua School of Business
[email protected]
Date: Thu, 8 Jul 2010 23:30:05 +0200
From: "Martin Weiss" <[email protected]>
Subject: st: RE: STATA equivalent SAS code
<>
I am not an SAS user myself, but you may want to look at -inlist()-
HTH
Martin
- -----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jose Benuzillo
Sent: Donnerstag, 8. Juli 2010 23:26
To: [email protected]
Subject: st: STATA equivalent SAS code
Hi all,
What is the Stata equivalent of the following SAS code?
If varx in (value1,value2,value3) then do;
Thanks
- -jose
*
* 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/