fit2sls: 2SLS Regression

Description Usage Arguments Value Author(s) See Also Examples

View source: R/lm2sls.R

Description

The work-horse 2SLS function, not normally meant to be called directly but rather via lm2sls.

Usage

1
fit2sls(y, X, Z, wt = NULL, singular.ok = FALSE, qr = TRUE)

Arguments

y

The response variable, a vector.

X

The explanatory-variables model matrix.

Z

The instrumental-variables model matrix.

wt

An optional weight vector.

singular.ok

Is perfect collinearity tolerable in either stage regression?

qr

Include the QR decomposition in the returned object.

Value

A list with the following components:

n

number of cases

p

number of columns of X

q

number of columns of Z

qr

QR decomposition for stage-2 regression

rank

rank of model matrix for stage-2 regression

qr.1

QR decomposition for stage-1 regression

rank.1

rank of Z

coefficients

estimated regression coefficients

coefficients.1

coefficient matrix from stage-1 regression

vcov

covariance matrix of estimated coefficients

df.residual

residual degrees of freedom for stage-2 regression

sigma

residual standard deviation

residuals

response residuals

fitted

model fitted values

residuals.1

matrix of stage-1 residuals

fitted.1

matrix of stage-1 fitted values

residuals.2

stage-2 residuals

fitted.2

stage-2 fitted values

weights

model weights or NULL

Author(s)

John Fox jfox@mcmaster.ca

See Also

lm2sls

Examples

1
2
3
4
m <- with(Kmenta, fit2sls(Q, cbind(1, P, D), cbind(1, D, F, A)))
names(m)
m$coefficients # estimates
sqrt(diag(m$vcov)) # standard errors

john-d-fox/lm2sls documentation built on Nov. 4, 2019, 3:05 p.m.