The function does Two-Stage Least Squares Estimation (TSLS).
tsls(x, ...)# S3 method for default
tsls(x, d, y, z, intercept = TRUE, homoscedastic = TRUE, ...)
# S3 method for formula
tsls(formula, data, intercept = TRUE, homoscedastic = TRUE, ...)
The function returns a list with the following elements
coefficients
variance-covariance matrix
outcome minus predicted values
function call
sample size
standard error
exogenous variables
further arguments (only for consistent defintion of methods)
endogenous variables
outcome variable
instruments
logical, if intercept should be included
logical, if homoscedastic (TRUE
, default) or heteroscedastic erros (FALSE
) should be calculated.
An object of class Formula
of the form " y ~ x + d | x + z" with y the outcome variable,
d endogenous variable, z instrumental variables, and x exogenous variables.
An optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model.
If not found in data, the variables are taken from environment(formula), typically the environment from which tsls
is called.
The function computes tsls estimate (coefficients) and variance-covariance-matrix assuming homoskedasticity
for outcome variable y
where d
are endogenous variables in structural equation, x
are exogensous variables in
structural equation and z are instruments. It returns an object of class tsls
for which the methods print
and summary
are provided.