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: RE: STATA equivalent SAS code
From
Jose Benuzillo <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: RE: RE: STATA equivalent SAS code
Date
Fri, 9 Jul 2010 09:53:54 -0600
Dan,
Thanks for making me aware of this site. I program in SAS but my boss is more comfortable in STATA so this site will serve me well to quickly adapt my SAS code
Best,
-jose
________________________________________
From: [email protected] [[email protected]] On Behalf Of Dan Blanchette [[email protected]]
Sent: Friday, July 09, 2010 8:17 AM
To: [email protected]
Subject: st: RE: STATA equivalent SAS code
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/
*
* 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/