File: vcovSCC.Rd

package info (click to toggle)
r-cran-plm 2.6-2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,032 kB
  • sloc: sh: 13; makefile: 4
file content (125 lines) | stat: -rw-r--r-- 4,325 bytes parent folder | download
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tool_vcovG.R
\name{vcovSCC}
\alias{vcovSCC}
\alias{vcovSCC.plm}
\alias{vcovSCC.pcce}
\title{Driscoll and Kraay (1998) Robust Covariance Matrix Estimator}
\usage{
vcovSCC(x, ...)

\method{vcovSCC}{plm}(
  x,
  type = c("HC0", "sss", "HC1", "HC2", "HC3", "HC4"),
  cluster = "time",
  maxlag = NULL,
  inner = c("cluster", "white", "diagavg"),
  wj = function(j, maxlag) 1 - j/(maxlag + 1),
  ...
)

\method{vcovSCC}{pcce}(
  x,
  type = c("HC0", "sss", "HC1", "HC2", "HC3", "HC4"),
  cluster = "time",
  maxlag = NULL,
  inner = c("cluster", "white", "diagavg"),
  wj = function(j, maxlag) 1 - j/(maxlag + 1),
  ...
)
}
\arguments{
\item{x}{an object of class \code{"plm"} or \code{"pcce"}}

\item{\dots}{further arguments}

\item{type}{the weighting scheme used, one of \code{"HC0"}, \code{"sss"},
\code{"HC1"}, \code{"HC2"}, \code{"HC3"}, \code{"HC4"}, see Details,}

\item{cluster}{switch for vcovG; set at \code{"time"} here,}

\item{maxlag}{either \code{NULL} or a positive integer specifying the
maximum lag order before truncation}

\item{inner}{the function to be applied to the residuals inside the
sandwich: \code{"cluster"} for SCC, \code{"white"} for Newey-West,
(\code{"diagavg"} for compatibility reasons)}

\item{wj}{weighting function to be applied to lagged terms,}
}
\value{
An object of class \code{"matrix"} containing the estimate of
the covariance matrix of coefficients.
}
\description{
Nonparametric robust covariance matrix estimators \emph{a la
Driscoll and Kraay} for panel models with cross-sectional
\emph{and} serial correlation.
}
\details{
\code{vcovSCC} is a function for estimating a robust covariance matrix
of parameters for a panel model according to the
\insertCite{DRIS:KRAA:98;textual}{plm} method, which is consistent
with cross--sectional and serial correlation in a T-asymptotic
setting and irrespective of the N dimension. The use with random
effects models is undocumented.

Weighting schemes specified by \code{type} are analogous to those in
\code{\link[sandwich:vcovHC]{sandwich::vcovHC()}} in package \CRANpkg{sandwich} and are
justified theoretically (although in the context of the standard
linear model) by \insertCite{MACK:WHIT:85;textual}{plm} and
\insertCite{CRIB:04;textual}{plm} \insertCite{@see @ZEIL:04}{plm}).

The main use of \code{vcovSCC} (and the other variance-covariance estimators
provided in the package \code{vcovHC}, \code{vcovBK}, \code{vcovNW}, \code{vcovDC}) is to pass
it to plm's own functions like \code{summary}, \code{pwaldtest}, and \code{phtest} or
together with testing functions from the \code{lmtest} and \code{car} packages. All of
these typically allow passing the \code{vcov} or \code{vcov.} parameter either as a
matrix or as a function, e.g., for Wald--type testing: argument \code{vcov.} to
\code{coeftest()}, argument \code{vcov} to \code{waldtest()} and other methods in the
\CRANpkg{lmtest} package; and argument \code{vcov.} to
\code{linearHypothesis()} in the \CRANpkg{car} package (see the
examples), \insertCite{@see also @ZEIL:04}{plm}, 4.1-2, and examples below.
}
\examples{

data("Produc", package="plm")
zz <- plm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp, data=Produc, model="pooling")
## as function input to plm's summary method (with and without additional arguments):
summary(zz, vcov = vcovSCC)
summary(zz, vcov = function(x) vcovSCC(x, method="arellano", type="HC1"))
## standard coefficient significance test
library(lmtest)
coeftest(zz)
## SCC robust significance test, default
coeftest(zz, vcov.=vcovSCC)
## idem with parameters, pass vcov as a function argument
coeftest(zz, vcov.=function(x) vcovSCC(x, type="HC1", maxlag=4))
## joint restriction test
waldtest(zz, update(zz, .~.-log(emp)-unemp), vcov=vcovSCC)
\dontrun{
## test of hyp.: 2*log(pc)=log(emp)
library(car)
linearHypothesis(zz, "2*log(pc)=log(emp)", vcov.=vcovSCC)
}
}
\references{
\insertRef{CRIB:04}{plm}

\insertRef{DRIS:KRAA:98}{plm}

\insertRef{HOEC:07}{plm}

\insertRef{MACK:WHIT:85}{plm}

\insertRef{ZEIL:04}{plm}
}
\seealso{
\code{\link[sandwich:vcovHC]{sandwich::vcovHC()}} from the \CRANpkg{sandwich}
package for weighting schemes (\code{type} argument).
}
\author{
Giovanni Millo, partially ported from Daniel Hoechle's
(2007) Stata code
}
\keyword{regression}