Archives for the ‘Stata’ Category

Stata for stocks

The people at StataCorp are on Facebook, and the other day they linked to this blog post by Paul Clist about checking on a stock you might own through clever use of the stockquote Stata command. Last year I bought some Netflix stock when it fell to $77 after the Qwikster fail. I agreed with [...]

Turn a date into Stata format quickly

There's a little program that's shown up more than once now in my housekeeping do-files, so it may be useful enough for a blog post, but it doesn't quite warrant a spot in c(sysdir_personal) as a stand-alone ado-file. Here: // turn this date to Stata format // if it's not that way already capture prog [...]

Human rights stats, part 1

I follow @simplystats on Twitter, and on March 1 they had a post that linked to an article in Foreign Policy about a guy who has the coolest job in applied stats. He works here. The original piece described a quick algorithm that you can use to estimate the number of human rights violations using [...]

Stata 12 with MacVim, updated

A while back I showed how to get Stata 12 to work with MacVim. This is to let you know about a bug fix. I posted the details on the Statalist just now. If you're reading this blog and you're not also a Statalist subscriber, you may want to change that.

A quick tip for using Stata in interactive mode

You don't always want to start a do-file in the editor for every small thing, though I usually do, and then trash it if I don't need it. So, my default stance is that I want to preserve work for later. Yours may be the opposite. If so, one option is to type in the [...]

How many zeroes in that Poisson?

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 [...]

Mapping Durham

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

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

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

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 [...]