# Articles by diffuseprior

### Undemocratic Democracies

January 7, 2018 |

I’ve always thought that it was ironic that most countries with the word “Democratic” in their name are exceptionally un-democratic in reality. So I was very interested in the following post on Reddit this week showing exactly this (https://www.reddit.com/r/dataisbeautiful/comments/7nkyek/countries_with_the_...

### Speeding up the Cluster Bootstrap in R

December 11, 2015 |

Back in January 2013 I wrote a blog post showing how to implement a basic cluster/block bootstrap in R. One drawback of the cluster bootstap is the length of time it takes to sample with replacement and create the data samples. Thankfully some of the comments on my previous post ... [Read more...]

### Why I use Panel/Multilevel Methods

July 24, 2015 |

I don’t understand why any researcher would choose not to use panel/multilevel methods on panel/hierarchical data. Let’s take the following linear regression as an example: , where is a random effect for the i-th group. A pooled OLS regression model for the above is unbiased and consistent. ...

### How Predictable is the English Premier League?

May 19, 2015 |

The reason why football is so exciting is uncertainty. The outcome of any match or league is unknown, and you get to watch the action unfold without knowing what’s going to happen. Watching matches where you know the score is never exciting. This weekend the English Premier League season ...

### Coal and the Conservatives

May 11, 2015 |

Interesting election results in the UK over the weekend, where the Conservatives romped to victory. This was despite a widespread consensus that neither the Conservative or Labour party would get a majority. This was a triumph for uncertainty and random error over the deterministic, as none of the statistical forecasts ...

June 13, 2014 |

If history can tell us anything about the World Cup, it’s that the host nation has an advantage of all other teams. Evidence of this was presented last night as the referee in the Brazil-Croatia match unjustly ruled in Brazil’s favour on several occasions. But what it is ... [Read more...]

### The ivlewbel Package. A new way to Tackle Endogenous Regressor Models.

May 15, 2014 |

In April 2012, I wrote this blog post demonstrating an approach proposed in Lewbel (2012) that identifies endogenous regressor coefficients in a linear triangular system. Now I am happy to announce the release of the ivlewbel package, which contains a function through which Lewbel’s method can be applied in R. This ... [Read more...]

### IV Estimates via GMM with Clustering in R

April 1, 2014 |

In econometrics, generalized method of moments (GMM) is one estimation methodology that can be used to calculate instrumental variable (IV) estimates. Performing this calculation in R, for a linear IV model, is trivial. One simply uses the gmm() function in the excellent gmm package like an lm() or ivreg() function. ... [Read more...]

### Within Group Index in R

February 4, 2014 |

There are many occasions in my research when I want to create a within group index for a data frame. For example, with demographic data for siblings one might want to create a birth order index. The below illustrates a simple example of how one can create such an index ... [Read more...]

### Detecting Weak Instruments in R

September 23, 2013 |

Any instrumental variables (IV) estimator relies on two key assumptions in order to identify causal effects: That the excluded instrument or instruments only effect the dependent variable through their effect on the endogenous explanatory variable or variables (the exclusion restriction), That the correlation between the excluded instruments and the endogenous ... [Read more...]

### Endogenous Spatial Lags for the Linear Regression Model

August 18, 2013 |

Over the past number of years, I have noted that spatial econometric methods have been gaining popularity. This is a welcome trend in my opinion, as the spatial structure of data is something that should be explicitly included in the empirical modelling procedure. Omitting spatial effects assumes that the location ... [Read more...]

### How Much Should Bale Cost Real?

August 5, 2013 |

It looks increasingly likely that Gareth Bale will transfer from Tottenham to Real Madrid for a world record transfer fee. Negotiations are ongoing, with both parties keen to get the best deal possible deal with the transfer fee. Reports speculate that this transfer fee will be anywhere in the very ... [Read more...]

### The Frisch–Waugh–Lovell Theorem for Both OLS and 2SLS

June 5, 2013 |

The Frisch–Waugh–Lovell (FWL) theorem is of great practical importance for econometrics. FWL establishes that it is possible to re-specify a linear regression model in terms of orthogonal complements. In other words, it permits econometricians to partial out right-hand-side, or control, variables. This is useful in a variety of ... [Read more...]

### Kalkalash! Pinpointing the Moments “The Simpsons” became less Cromulent

April 30, 2013 |

Whenever somebody mentions “The Simpsons” it always stirs up feelings of nostalgia in me. The characters, uproarious gags, zingy one-liners, and edgy animation all contributed towards making, arguably, the greatest TV ever. However, it’s easy to forget that as a TV show “The Simpsons” is still ongoing—in its ... [Read more...]

### texreg: A package for beautiful and easily customizable LaTeX regression tables from R

January 20, 2013 |

There was a very informative post last week showing how the R package stargazer is used to generate nice LaTeX tables from a number of R objects. This package looks very useful. However, I would like to extol the virtues of another R package that converts model objects in R ... [Read more...]

### The Cluster Bootstrap

January 12, 2013 |

Adjusting standard errors for clustering can be a very important part of any statistical analysis. For example, duplicating a data set will reduce the standard errors dramatically despite there being no new information. I have previously dealt with this topic with reference to the linear regression model. However, in many ... [Read more...]

### Identical Champions League Draw: What Were the Odds?

December 24, 2012 |

A number of news outlets have reported a peculiar quirk that arose during Friday’s Champions League draw. Apparently, the sport’s European governing body, UEFA, ran a trial run the day before the main event, and the schedule chosen during this event was identical to that of the actual ... [Read more...]

### Linear Models with Multiple Fixed Effects

December 11, 2012 |

Estimating a least squares linear regression model with fixed effects is a common task in applied econometrics, especially with panel data. For example, one might have a panel of countries and want to control for fixed country factors. In this case the researcher will effectively include this fixed identifier as ... [Read more...]

### Minimizing Bias in Observational Studies

November 26, 2012 |

Measuring the effect of a binary treatment on a measured outcome is one of the most common tasks in applied statistics. Examples of these applications abound, like the effect of smoking on health, or the effect of low birth weight on cognitive development. In an ideal world we would like ... [Read more...]

### Heteroskedastic GLM in R

November 20, 2012 |

A commenter on my previous blog entry has drawn my attention to an R function called hetglm() that estimates heteroskedastic probit models. This function is contained in the glmx package. The glmx package is not available on CRAN yet, but thankfully can be downloaded here. The hetglm() function has a ... [Read more...]
1 2 3