tsls-methods: ~~ Methods for Function 'tsls' in Package 'gmm4' ~~

Description Usage Arguments Methods Examples

Description

It estimates a linear model using two-stage least squares.

Usage

1
2
## S4 method for signature 'linearGmm'
tsls(model)

Arguments

model

An object of class gmmModels.

Methods

signature(model = "linearGmm")
signature(model = "slinearGmm")

2SLS for equation by equation estimation of a system of equations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
x <- rchisq(200,5)
z1 <- rnorm(200)
z2 <- .2*x+rnorm(200)
y <- x+rnorm(200)
dat <- data.frame(y=y,z1=z1,x=x,z2=z2)
theta <- c(beta0=1,beta1=2)
model1 <- gmmModel(y~x, ~z1+z2, data=dat)
res <- tsls(model1)
summary(res)

## Econometrics, Fumio Hayashi (2000)
## Empirical exercises (b) and (c)
data(Griliches)
Griliches$YEAR <- as.factor(Griliches$YEAR)
model1  <- gmmModel(LW~S+IQ+EXPR+TENURE+RNS+SMSA+YEAR-1,
                   ~S+EXPR+TENURE+RNS+SMSA+YEAR+MED+KWW+MRT+AGE-1,
                   data=Griliches, vcov="MDS")
res <- tsls(model1)
summary(res)

gmm4 documentation built on Dec. 6, 2019, 3:01 a.m.