Archives for posts tagged ‘macros’

Another use for local macros: Stata graphs

Graphs are tricky beasts in every programming environment. There are so many ways in which you might want them that any command for drawing them will have to be laden with options and it will probably run over numerous lines.
Stata, from version 8 onward, has done a wonderful job of taking the pain out of [...]

Fun with display and macros

Turns out anything you can display -- or di -- on the screen, you can also send to a macro to use later. How useful is that? Well, sometimes you need to say the same thing in different ways. The macro may be set to capture either the form or the substance, depending on which [...]

Data from MS Access to Stata

In my oldest post about the odbc load command I mentioned that you can pretty easily read data from MS Access into Stata, and even execute SQL commands from within Stata, but I dismissed the whole thing a bit too lightly. A recent look on Google Analytics showed that some people came here looking for [...]

Abstraction with macros

When professional programmers talk about abstraction they mean writing code that is not too context-specific. The goal of abstraction is platform-independent code. That has become synonymous with "runs on both UNIX and Windows" but platform need not mean operating system. PHP, for example, has a database abstraction layer called PEAR::DB whose job is to allow [...]