Description Usage Arguments Details Value Author(s) References See Also Examples

This function estimates an Instrumental Variable (IV) system while incorporating model uncertainty and performing model averaging using an MC3-within-Gibbs Sampler.

1 2 |

`Y` |
n x 1 matrix. Response variable |

`X` |
n x r matrix. Endogenous variables |

`W` |
n x p matrix. Further explanatory variables. You are responsible for including an intercept. |

`Z` |
n x q matrix. Instrumental variables |

`s` |
integer. Number of iterations |

`b` |
integer. Number of iterations to discard as burn-in. |

`full` |
If full is TRUE then model selection is not performed |

`odens` |
Output density. How many samples from the posterior should be returned? Note that posterior expectations are taken over every sample after burn-in |

`print.every` |
After how many iterations should the progress be printed? |

`run.diagnostics` |
If TRUE, this will compute experimental diagnostics to assess the validity of the instruments in use. Note that this adds a non-negligible amount of computing time. |

The function estimates the parameters based on the model

*Y = [X W] * ρ + ε*

*X = [Z W] * λ + η*

with

*(ε_i, η_i)^T \sim N_2 ( 0,Σ)*

and its extension to multiple endogenous variables.
If `full`

is set to `FALSE`

model uncertainty is included
using conditional Bayes factors.

`rho` |
An odens x (r + p) matrix with sampled values for the outcome stage. Endogenous variables come first. |

`rho.bar` |
Posterior expectation of the outcome stage taken over all iterations |

`lambda` |
A (p + q) x r x odens array with sampled values for the parameters of the first stage regressions. Instruments come first. |

`lambda.bar` |
Posterior expectation of each first stage taken over all iterations |

`Sigma` |
odens sampled realizations of Sigma |

`Sigma.bar` |
Posterior expectation of Sigma taken over all iterations |

`M` |
Sampled first stage models |

`M.bar` |
Posterior first stage inclusion probabilities |

`L` |
Sampled second stage models |

`L.bar` |
Posterior second stage inclusion probabilities |

If run.diagnostics was set to TRUE then you also receive

`Sargan` |
Model averaged Sargan p-values. Lower values indicate lack of instrument validity |

`Bayesian.Sargan` |
An _Experimental_ Bayesian Sargan diagnostic based on Conditional Bayes Factors. Same direction as above |

Alex Lenkoski ([email protected])

Anna Karl and Alex Lenkoski (2012). "Instrumental Variable Bayesian Model Averaging via Conditional Bayes Factors" http://arxiv.org/abs/1202.5846

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
set.seed(1)
data(growth)
attach(growth)
## To replicate KL, set s to 1e5
a <- ivbma(Y, X, Z, W, s = 1e2)
summary(a, nms.U = c(names(Z), names(W)),nms.V = c(names(X), names(W)))
detach(growth)
set.seed(1)
data(margarine)
attach(margarine)
## To replicate KL, set s to 2.5e5
a <- ivbma(Y, X, Z, W, s=1e2)
summary(a, nms.U = c(names(Z), names(W)),nms.V = c(names(X), names(W)))
detach(margarine)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.