Publications by diffuseprior
Endogenous Spatial Lags for the Linear Regression Model
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 co-ordinates for observations ar...
6754 sym R (2874 sym/1 pcs) 90 img
Detecting Weak Instruments in R
Weak Instruments 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 exclude...
3151 sym R (3325 sym/2 pcs) 6 img
Within Group Index in R
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 in R. set.seed(123) # two families/groups 1 and 2 # with random ages data = d...
678 sym R (314 sym/1 pcs) 4 img
IV Estimates via GMM with Clustering in R
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. The gmm() function will estima...
1977 sym R (1485 sym/1 pcs) 4 img
The ivlewbel Package. A new way to Tackle Endogenous Regressor Models.
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 package is now available to d...
1039 sym R (932 sym/1 pcs) 6 img
Brazil’s Host Advantage
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 the statistical evidence of a host advantage? To look at this, I downloa...
1824 sym R (438 sym/1 pcs) 6 img
Coal and the Conservatives
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 appeared to deem such a dec...
2025 sym R (1337 sym/1 pcs) 6 img
How Predictable is the English Premier League?
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 will conclude with little fanfare. Bar one relegation pla...
3649 sym R (3343 sym/1 pcs) 6 img
Why I use Panel/Multilevel Methods
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. However, it will be inefficient, unless for all . ...
2059 sym R (3206 sym/1 pcs) 22 img
Speeding up the Cluster Bootstrap in R
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 illustrated simple ways to get speed gains. However, even with these...
2946 sym R (2058 sym/1 pcs) 4 img