tsls function

Two-Stage Least Squares Estimation (TSLS)

Two-Stage Least Squares Estimation (TSLS)

The function does Two-Stage Least Squares Estimation (TSLS).

tsls(x, ...) ## Default S3 method: tsls(x, d, y, z, intercept = TRUE, homoscedastic = TRUE, ...) ## S3 method for class 'formula' tsls(formula, data, intercept = TRUE, homoscedastic = TRUE, ...)

Arguments

  • x: exogenous variables
  • ...: further arguments (only for consistent defintion of methods)
  • d: endogenous variables
  • y: outcome variable
  • z: instruments
  • intercept: logical, if intercept should be included
  • homoscedastic: logical, if homoscedastic (TRUE, default) or heteroscedastic erros (FALSE) should be calculated.
  • formula: 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.
  • data: 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.

Returns

The function returns a list with the following elements - coefficients: coefficients

  • vcov: variance-covariance matrix - residuals: outcome minus predicted values - call: function call - samplesize: sample size

  • se: standard error

Details

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.

  • Maintainer: Martin Spindler
  • License: MIT + file LICENSE
  • Last published: 2024-02-14

Useful links