tsls: Two-Stage Least Squares Estimation (TSLS)

View source: R/tsls.R

tslsR Documentation

Two-Stage Least Squares Estimation (TSLS)

Description

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

Usage

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.

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.

Value

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


hdm documentation built on May 29, 2024, 3:35 a.m.