Articles by diffuseprior

The Heteroskedastic Probit Model

November 19, 2012 | diffuseprior

Specification testing is an important part of econometric practice. However, from what I can see, few researchers perform heteroskedasticity tests after estimating probit/logit models. This is not a trivial point. Heteroskedasticity in these models can represent a major violation of the probit/logit specification, both of which assume homoskedastic ... [Read more...]

BMR: Bayesian Macroeconometrics in R

September 4, 2012 | diffuseprior

The recently released BMR package, short for Bayesian Macroeconometrics with R, provides a comprehensive set of powerful routines that estimate Bayesian Vector Autoregression (VAR) and Dynamic Stochastic General Equilibrium (DSGE) models in R. The procedure of estimating both Bayesian VAR and DSGE models can represent a great computational burden. However, ... [Read more...]

Probit Models with Endogeneity

August 15, 2012 | diffuseprior

Dealing with endogeneity in a binary dependent variable model requires more consideration than the simpler continuous dependent variable case. For some, the best approach to this problem is to use the same methodology used in the continuous case, i.e. 2 stage least squares. Thus, the equation of interest becomes a ... [Read more...]

Combining ggplot Images

July 3, 2012 | diffuseprior

The ggplot2 package provides an excellent platform for data visualization. One (minor) drawback of this package is that combining ggplot images into one plot, like the par() function does for regular plots, is not a straightforward procedure. Fortunately, R user Stephen Turner has kindly provided a function called “arrange” that ... [Read more...]

How to Convert Rugby into Football/Soccer Scores

June 26, 2012 | diffuseprior

Following the Irish rugby team’s humiliating 60-0 defeat to New Zealand, an interesting question was posed on Twitter: what does a 60-0 result convert to in football/soccer? Intrigued, I decided to gather some data from both the English premier league (this season, more data collected and future blog ... [Read more...]

Standard, Robust, and Clustered Standard Errors Computed in R

June 15, 2012 | diffuseprior

Where do these come from? Since most statistical packages calculate these estimates automatically, it is not unreasonable to think that many researchers using applied econometrics are unfamiliar with the exact details of their computation. For the purposes of illustration, I am going to estimate different standard errors from a basic ... [Read more...]

Visualizing Euro 2012: First Group Games

June 12, 2012 | diffuseprior

Now that every team has played a match it will be interesting to see how this has affected the (inverse) odds of victory. Since the plot in my last post was a bit ‘busy’, I have decided to use the facet_wrap function in gglplot2 to stratify by group. Also, ... [Read more...]

Visualizing Euro 2012 with ggplot2

June 9, 2012 | diffuseprior

After scanning this paper by Zeileis, Leitner & Hornik, I thought it would be interesting to see how the victory odds for each team changes as Euro 2012 progresses. To do this, I am going to collect the daily inverse odds of a tournament victory offered by a popular betting site for ... [Read more...]

Let’s Party!

June 6, 2012 | diffuseprior

Exploring whether regression coefficients differ between groups is an important part of applied econometric research, and particularly for research with a policy based objective. For example, a government in a developing country may decide to introduce free school lunches in an effort to improve childhood health. However, if this treatment ... [Read more...]

Optim, you’re doing it wrong?

May 28, 2012 | diffuseprior

Call me uncouth, but I like my TV loud, my beer cold and my optimization functions as simple as possible. Therefore, what I write in this blog post is very much from a layman’s perspective, and I am happy to be corrected on any fundamental errors. I have recently ... [Read more...]

Time-Series Policy Evaluation in R

May 21, 2012 | diffuseprior

Quantifying the success of government policies is clearly important. Randomized control trials, like those conducted by drug companies, are often described as the ‘gold-standard’ for policy evaluation. Under these, a policy is implemented in/to one area/group (treatment), but not in/to another (control). The difference in outcomes between ... [Read more...]

Simple Spatial Correlograms for Cross-Country Analysis in R

May 9, 2012 | diffuseprior

Accounting for temporal dependence in econometric analysis is important, as the presence of temporal dependence violates the assumption that observations are independent units. Historically, much less attention has been paid to correcting for spatial dependence, which, if present, also violates this independence assumption. The comparability of temporal and spatial dependence ... [Read more...]

An ivreg2 function for R

May 3, 2012 | diffuseprior

The ivreg2 command is one of the most popular routines in Stata. The reason for this popularity is its simplicity. A one-line ivreg2 command generates not only the instrumental variable regression coefficients and their standard errors, but also a number of other statistics of interest. I have come across a ... [Read more...]

Probit/Logit Marginal Effects in R

April 23, 2012 | diffuseprior

The common approach to estimating a binary dependent variable regression model is to use either the logit or probit model. Both are forms of generalized linear models (GLMs), which can be seen as modified linear regressions that allow the dependent variable to originate from non-normal distributions. The coefficients in a ... [Read more...]

Dummies for Dummies

April 19, 2012 | diffuseprior

Most R functions used in econometrics convert factor variables into a set of dummy/binary variables automatically. This is useful when estimating a linear model, saving the user from the laborious activity of manually including the dummy variables as regressors. However, what if you want to reshape your dataframe so ... [Read more...]

Instrumental Variables without Traditional Instruments

April 14, 2012 | diffuseprior

Typically, regression models in empirical economic research suffer from at least one form of endogeneity bias. The classic example is economic returns to schooling, where researchers want to know how much increased levels of education affect income. Estimation using a simple linear model, regressing income on schooling, alongside a bunch ... [Read more...]

Temperature Change in Ireland

April 7, 2012 | diffuseprior

Has Ireland gotten any warmer? Ask any punter on the street and they will happily inform you of wild swings, trends and dips. “Back when I was a child”, “when I was younger”, or “years ago” are the usual refrains. What’s the evidence? To answer this, I will use ... [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)