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]

From |
Daniel Feenberg <feenberg@nber.org> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: RE: st: Converting a SAS datastep to Stata |

Date |
Thu, 16 Dec 2010 16:17:25 -0500 (EST) |

On Thu, 16 Dec 2010, William Gould, StataCorp LP wrote:

I just sent a posting to Statalist concerning Daniel Feenberg's <feenberg@nber.org> SAS-to-Stata issue. Others have replied, too, and many are saying, "Use Mata!". I'm a little embarrassed because, concerning Mata, I merely ended my posting with,Daniel could use Mata. That would address both the readability and efficiency issues. If I were writing this code for the first time, that is what I would do, probably. With Mata, I can go through the observations one at a time just as SAS does.

Do you mean a "for" loop over observations? : for ( 1; st_nobs();1) { if FLPDYR[i] == 2003 { (calculations...) } }

I'm embarrassed because I am the author of the "Mata Matters" column in the SJ. I'm supposedly qualified because I'm the author of Mata, too, but the editors of the SJ may be reconsidering. So please pretend I too said, "Use Mata!" and added a lot of useful comments about Mata. Mata is, in fact, very appropriate for Daniel's problem. I didn't push the Mata solution for two reasons: (1) I pretty much ignored efficiency issues and (2) I was unsure of how much Mata Daniel knew. Assuming efficiency is not Daniel's primary concern, and assuming time-of-implementation is, I stand behind my Stata solution.

Daniel Feenberg NBER

I don't want to be thought of as one-sided. Cheers, -- Bill wgould@stata.com * * 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/

**References**:**Re: RE: st: Converting a SAS datastep to Stata***From:*wgould@stata.com (William Gould, StataCorp LP)

- Prev by Date:
**RE: st: RE: RE: comparing different means using ttest** - Next by Date:
**Re: st: RE: Survival analysis - individual survival functions** - Previous by thread:
**RE: RE: st: Converting a SAS datastep to Stata** - Next by thread:
**Re: RE: st: Converting a SAS datastep to Stata** - Index(es):