wald | R Documentation |
Wald test used to test the joint nullity of a set of coefficients.
wald(x, keep = NULL, drop = NULL, print = TRUE, vcov, se, cluster, ...)
x |
A |
keep |
Character vector. This element is used to display only a subset of variables. This
should be a vector of regular expressions (see |
drop |
Character vector. This element is used if some variables are not to be displayed.
This should be a vector of regular expressions (see |
print |
Logical, default is |
vcov |
Versatile argument to specify the VCOV. In general, it is either a character
scalar equal to a VCOV type, either a formula of the form: |
se |
Character scalar. Which kind of standard error should be computed:
“standard”, “hetero”, “cluster”, “twoway”, “threeway”
or “fourway”? By default if there are clusters in the estimation:
|
cluster |
Tells how to cluster the standard-errors (if clustering is requested).
Can be either a list of vectors, a character vector of variable names, a formula or
an integer vector. Assume we want to perform 2-way clustering over |
... |
Any other element to be passed to |
The type of VCOV matrix plays a crucial role in this test. Use the arguments se
and
cluster
to change the type of VCOV for the test.
A named vector containing the following elements is returned: stat
, p
, df1
,
and df2
. They correspond to the test statistic, the p-value, the first and
second degrees of freedoms.
If no valid coefficient is found, the value NA
is returned.
data(airquality)
est = feols(Ozone ~ Solar.R + Wind + poly(Temp, 3), airquality)
# Testing the joint nullity of the Temp polynomial
wald(est, "poly")
# Same but with clustered SEs
wald(est, "poly", cluster = "Month")
# Now: all vars but the polynomial and the intercept
wald(est, drop = "Inte|poly")
#
# Toy example: testing pre-trends
#
data(base_did)
est_did = feols(y ~ x1 + i(period, treat, 5) | id + period, base_did)
# The graph of the coefficients
coefplot(est_did)
# The pre-trend test
wald(est_did, "period::[1234]$")
# If "period::[1234]$" looks weird to you, check out
# regular expressions: e.g. see ?regex.
# Learn it, you won't regret it!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.