model.matrix.2sls: Methods for '"2sls"' Objects

Description Usage Arguments See Also Examples

View source: R/lm2sls.R

Description

Various methods for processing "2sls" objects; for diagnostic methods, see 2SLS_Diagnostics.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## S3 method for class '2sls'
model.matrix(object, type = c("model", "instruments",
  "stage2"), ...)

## S3 method for class '2sls'
avPlot(model, ...)

## S3 method for class '2sls'
vcov(object, ...)

## S3 method for class '2sls'
residuals(object, type = c("response", "stage1", "stage2",
  "working", "deviance", "pearson", "partial"), ...)

## S3 method for class '2sls'
fitted(object, type = c("model", "stage1", "stage2"), ...)

## S3 method for class '2sls'
print(x, digits = getOption("digits") - 2, ...)

## S3 method for class '2sls'
summary(object, digits = getOption("digits") - 2,
  vcov. = vcov, ...)

## S3 method for class 'summary.2sls'
print(x, ...)

## S3 method for class '2sls'
anova(object, model.2, s2, dfe, ...)

## S3 method for class '2sls'
update(object, formula., instruments., ...,
  evaluate = TRUE)

## S3 method for class '2sls'
bread(x, ...)

## S3 method for class '2sls'
estfun(x, ...)

Arguments

object

An object of class "2sls".

type

Type of object desired, varies by method:

model.matrix

"model" (the default), "instruments", or "stage2".

residuals

"response", "stage1", "stage2", "working" (equivalent to "response"), "deviance", "pearson" (equivalent to "deviance"), or "partial".

fitted

"model", "stage1", or "stage2".

...

to match generics, not generally used.

model

An object of class "2sls" or "influence.2sls".

x

An object of class "2sls".

digits

Digits to print.

vcov.

Function to compute the coefficient covariance matrix or the matrix itself; the default is the function vcov; set, e.g., to sandwich (from the sandwich package) to get robust coefficient standard errors.

model.2

A second object of class "2sls".

s2

the estimated error variance (optional); if not specified, taken from the larger model.

dfe

the degrees of freedom for error (optional); if not specified, taken from the larger model.

formula.

Updated model formula.

instruments.

Updated one-sided formula for the instrumental variables.

evaluate

If TRUE (the default) evaluate the updated model; if FALSE simply generate the updated call.

See Also

lm2sls, 2SLS_Diagnostics, sandwich

Examples

1
2
3
4
5
6
kmenta.eq1 <- lm2sls(Q ~ P + D, ~ D + F + A, data=Kmenta)
coef(kmenta.eq1) # estimates
sqrt(diag(vcov(kmenta.eq1))) # std. errors
summary(kmenta.eq1)
summary(kmenta.eq1, vcov.=sandwich::sandwich) # sandwich SEs
plot(fitted(kmenta.eq1), residuals(kmenta.eq1)) # residuals vs fitted values

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