-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.matrix.2sls.Rd
102 lines (79 loc) · 3.14 KB
/
model.matrix.2sls.Rd
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lm2sls.R
\name{model.matrix.2sls}
\alias{model.matrix.2sls}
\alias{2SLS_Methods}
\alias{avPlot.2sls}
\alias{vcov.2sls}
\alias{residuals.2sls}
\alias{fitted.2sls}
\alias{print.2sls}
\alias{summary.2sls}
\alias{print.summary.2sls}
\alias{anova.2sls}
\alias{update.2sls}
\alias{bread.2sls}
\alias{estfun.2sls}
\title{Methods for \code{"2sls"} Objects}
\usage{
\method{model.matrix}{2sls}(object, type = c("model", "instruments",
"stage2"), ...)
\method{avPlot}{2sls}(model, ...)
\method{vcov}{2sls}(object, ...)
\method{residuals}{2sls}(object, type = c("response", "stage1", "stage2",
"working", "deviance", "pearson", "partial"), ...)
\method{fitted}{2sls}(object, type = c("model", "stage1", "stage2"), ...)
\method{print}{2sls}(x, digits = getOption("digits") - 2, ...)
\method{summary}{2sls}(object, digits = getOption("digits") - 2,
vcov. = vcov, ...)
\method{print}{summary.2sls}(x, ...)
\method{anova}{2sls}(object, model.2, s2, dfe, ...)
\method{update}{2sls}(object, formula., instruments., ...,
evaluate = TRUE)
\method{bread}{2sls}(x, ...)
\method{estfun}{2sls}(x, ...)
}
\arguments{
\item{object}{An object of class \code{"2sls"}.}
\item{type}{Type of object desired, varies by method:
\describe{
\item{\code{model.matrix}}{\code{"model"} (the default), \code{"instruments"}, or
\code{"stage2"}.}
\item{\code{residuals}}{\code{"response"}, \code{"stage1"}, \code{"stage2"},
\code{"working"} (equivalent to \code{"response"}), \code{"deviance"},
\code{"pearson"} (equivalent to \code{"deviance"}), or \code{"partial"}.}
\item{\code{fitted}}{\code{"model"}, \code{"stage1"}, or \code{"stage2"}.}
}}
\item{...}{to match generics, not generally used.}
\item{model}{An object of class \code{"2sls"} or \code{"influence.2sls"}.}
\item{x}{An object of class \code{"2sls"}.}
\item{digits}{Digits to print.}
\item{vcov.}{Function to compute the coefficient covariance matrix or the matrix itself;
the default is the function \code{vcov}; set, e.g., to \code{\link[sandwich]{sandwich}}
(from the \pkg{sandwich} package) to get robust coefficient standard errors.}
\item{model.2}{A second object of class \code{"2sls"}.}
\item{s2}{the estimated error variance (optional);
if not specified, taken from the larger model.}
\item{dfe}{the degrees of freedom for error (optional);
if not specified, taken from the larger model.}
\item{formula.}{Updated model formula.}
\item{instruments.}{Updated one-sided formula for the instrumental variables.}
\item{evaluate}{If \code{TRUE} (the default) evaluate the updated model;
if \code{FALSE} simply generate the updated call.}
}
\description{
Various methods for processing \code{"2sls"} objects; for diagnostic methods,
see \link{2SLS_Diagnostics}.
}
\examples{
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
}
\seealso{
\code{\link{lm2sls}}, \link{2SLS_Diagnostics},
\code{\link[sandwich]{sandwich}}
}