Articles by diffuseprior

Undemocratic Democracies

January 7, 2018 | diffuseprior

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_...
[Read more...]

Speeding up the Cluster Bootstrap in R

December 11, 2015 | diffuseprior

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 | diffuseprior

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

How Predictable is the English Premier League?

May 19, 2015 | diffuseprior

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

Coal and the Conservatives

May 11, 2015 | diffuseprior

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

Brazil’s Host Advantage

June 13, 2014 | diffuseprior

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

IV Estimates via GMM with Clustering in R

April 1, 2014 | diffuseprior

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 | diffuseprior

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 | diffuseprior

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 | diffuseprior

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 | diffuseprior

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 | diffuseprior

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

The Cluster Bootstrap

January 12, 2013 | diffuseprior

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 | diffuseprior

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 | diffuseprior

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 | diffuseprior

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 | diffuseprior

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

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)