I have a data set, and some of the variables there are counts of a given event. Four count outcomes, the easiest thing to do is a Poisson regression, but before you do that, it's worth asking if what you see there really is close enough to a Poisson process. You could check whether the [...]
Archives for the ‘Stata’ Category
Mapping Durham
Saturday, 19 November 2011
Today, Kirstin wanted to make a grocery trip to the Whole Foods at Bull City Market, then take Kate to the nearest playground. That seems to be Oval Drive Park, but it won't be obvious from querying the Durham Park LocatorĀ . No worries. The Durham Park Locator gives you a pretty nice table with all [...]
From Stata to Google Maps
Friday, 7 October 2011
At the Stata command line, type "findit geocode". You will turn up a command that matches physical addresses with latitude and longitude coordinates using the Google Maps API. Then if you type "findit writekml" you will turn up my first contribution to the SSC: a command that writes a KML file using latitude and longitude [...]
Stata 12 with MacVim
Wednesday, 14 September 2011
I used to run Stata 10 with Vim on Windows. Now I run Stata 12 with MacVim. In Windows, there is a nice way to integrate Stata and Vim based on the work of Friedrich Huebler and Dimitriy Masterov. A fairly straightforward combination of bash scripts, Vim functions and Applescript calls can achieve the same [...]
Factors in Stata and R
Monday, 22 August 2011
The quick version of this post goes like this: -- # in Stata is : in R -- ## in Stata is * in R. The long version is that both Stata and R handle very nicely factor variables in regression models. If you want a full-factorial interaction between a factor variable x1 and a [...]
Delayed macro substitution
Thursday, 10 February 2011
In Stata, you have local and global macros that can encapsulate all sorts of specific text: names of variables, constant values, even entire chunks of Stata code. Stata will interpret macros as soon as you invoke them, so that if you define local thedata sysuse auto local themodel regress mpg foreign weight you can simply [...]
Simulation
Monday, 3 January 2011
This paper by Victor S. Y. Lo came up in a conversation about how to best model treatment response in a business context, where the population of interest is the customers, and the treatment is some kind of marketing action -- you try and up-sell, cross-sell or simply keep them from buying from somewhere else. [...]
Dogs, bedbugs and Reverend Bayes
Friday, 12 November 2010
This morning I finished watching this, then I went and got my New York Times fix, where I found this. The two are connected because Hilary Mason's talk gave me a nice little reminder of the counterintuitive
Good to know
Thursday, 15 July 2010
The user-written commands you download to your ado/plus directory are updated once in a while on that RepEc server they come from. So, after you findit and then net install it, your imported command might need to be refreshed occasionally. That is what adoupdate, update does. I was reminded of this when I tried to [...]
The limits of encapsulation
Friday, 9 July 2010
I just read this. I liked it. It put some bit of anguish I've been having into clearer words than I could. My Stata code between 2000 and 2006 consisted exclusively of do-files that put to work either standard Stata commands or user-written commands from the SSC. There was not a single program definition anywhere [...]