Stata: Clustered Standard Errors

I have been implementing a fixed-effects estimator in Python so I can work with data that is too large to hold in memory. To make sure I was calculating my coefficients and standard errors correctly I have been comparing the calculations of my Python code to results from Stata. This lead me to find a surprising inconsistency in Stata’s calculation of standard errors. I illustrate the issue by comparing standard errors computed by Stata’s xtreg fe command to those computed by the standard regress command....

March 29, 2013 · 4 min · Andrew Marder

Anatomy of a Python Package

If all subsystems can communicate with all other subsystems, you lose the benefit of separating them at all. Make each subsystem meaningful by restricting communications. Steve McConnell Below is a tool for examining how modules in a Python package communicate with each other. Select a Python Package flask git jinja2 numpy Module Graph Each node in this graph is a module in the selected package. Edges indicate imports. Placing the mouse over a node selects that module and all of its dependencies....

September 19, 2012 · 1 min · Andrew Marder

How to ask questions

Good questions are a stimulus and a gift. Good questions help us develop our understanding, and often reveal problems we might not have noticed or thought about. This step-by-step procedure for asking good questions and giving helpful answers is an adaptation of How To Ask Questions The Smart Way. Define the problem. Try to solve the problem. Read the manual. Read the FAQ. Search the archives of the forum where you might ask for help....

April 5, 2012 · 3 min · Andrew Marder

SSH Key Bindings

Recently, I was asked how to set up an SSH client so that Ctrl-right would move forward a word. Here are some things I learned along the way. It turns out different SSH clients send different keycodes for the same keys! Anne Baretta describes an easy way to see what your client is sending to the terminal: The best way to trouble-shoot is using Ctrl-v key. Press Control and v simultaneously, release them, and then type one of the special keys, e....

March 22, 2012 · 1 min · Andrew Marder

Working with 64-bit Integers in R

Integers in R are stored in 32-bits. Out of the box, the largest integer R can handle is 2147483647. Sometimes this isn’t enough space. I’ve run into this issue a few times when dealing with large ID numbers. Here’s an example ID from Twitter 912411948163137536, let’s see if it’s larger than R can handle: 912411948163137536 > .Machine$integer.max ## [1] TRUE If we try to store this number as an integer, R warns us that it does not fit within the 32-bit integer range and it returns NA as this integer value is not available....

3 min · Andrew Marder