fsw | R Documentation |
fsw
calculates the conditional F-statistic of
Sanderson and Windmeijer (2016) for each endogenous variable
in the model.
fsw(object)
## S3 method for class 'ivreg'
fsw(object)
object |
An object of class |
An object of class "fsw"
with the following elements:
matrix with columns for the conditional F-statistics, degrees of freedom, residual degrees of freedom, and p-value. 1 row per endogenous variable.
a character vector of the variable names of the endogenous variables.
the number of endogenous variables.
the sample size used for the fitted model.
Sanderson E and Windmeijer F. A weak instrument F-test in linear IV models with multiple endogenous variables. Journal of Econometrics, 2016, 190, 2, 212-221, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jeconom.2015.06.004")}.
require(ivreg)
set.seed(12345)
n <- 4000
z1 <- rnorm(n)
z2 <- rnorm(n)
w1 <- rnorm(n)
w2 <- rnorm(n)
u <- rnorm(n)
x1 <- z1 + z2 + 0.2*u + 0.1*w1 + rnorm(n)
x2 <- z1 + 0.94*z2 - 0.3*u + 0.1*w2 + rnorm(n)
y <- x1 + x2 + w1 + w2 + u
dat <- data.frame(w1, w2, x1, x2, y, z1, z2)
mod <- ivreg::ivreg(y ~ x1 + x2 + w1 + w2 | z1 + z2 + w1 + w2, data = dat)
fsw(mod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.