Description Usage Arguments Details Value Author(s) References See Also Examples
Computes a test for a threshold in linear regression under heteroskedasticity.
1 2 3 4 5 6 7 8 9 10 11 12 |
df |
Data frame. |
yi |
Integer or character; index or column name of dependent (y)
variable in |
xi |
Integer or character vector; indexes or column names of
independent (x) variables in |
qi |
Integer or character; index or column name of threshold (q)
variable in |
var.names |
Character vector; variable names with
|
trim_per |
Numeric; percentage of sample to trim from ends.
Default is |
rep |
Integer; number of bootstrap replications. Default is
|
cr |
Numeric; confidence level used to plot the critical value in the
graph. It is not used elsewhere in the analysis. Default is
|
graph |
Logical; graph indicator.
Set |
quick |
Integer; indicator of method used for bootstrap.
Set |
Do not include a constant in the independent variables; the function automatically adds an intercept to the regression.
There are two bootstrap methods which the function can use.
The first method, obtained by setting quick = 1
,
is the method presented in the paper
Hansen, B. E. (1996). Inference When a Nuisance Parameter is Not
Identified Under the Null Hypothesis.
Econometrica, 64(2):413-430.
https://www.ssc.wisc.edu/~bhansen/papers/ecnmt_96.pdf,
which simulates the asymptotic null distribution.
A computational shortcut is also taken which speeds computational
time, at the cost of greater memory usage, so may not be possible
for large data sets.
The second method, obtained by setting quick = 2
,
is a "fixed regressor bootstrap", which is quite close.
The difference is that the bootstrap procedure calculates
the variance-covariance matrix in each bootstrap replication.
This results in a better finite sample approximation.
The cost is greater computation time.
The function is set by default to use the second method
(quick = 2
), which has better sampling properties.
If computational time is a concern, switch to the first method
(quick = 1
). If an "out of workspace memory" message appears,
switch back to quick = 2
.
A list with components:
f_test
the value of Maximal (Quandt) F-statistic.
p_value
the bootstrap p-value.
Marcel Kremer, marcel.kremer@uni-due.de
Bruce E. Hansen, behansen@wisc.edu
Hansen, B. E. (2000). Sample splitting and threshold estimation. Econometrica, 68(3):575–603. https://doi.org/10.1111/1468-0262.00124. https://www.ssc.wisc.edu/~bhansen/papers/ecnmt_00.pdf.
thr_test_hom
for threshold test under homoskedasticity,
thr_est
for threshold estimation.
1 2 3 4 5 6 | ## Performs part of the empirical work reported in Hansen (2000)
data <- dur_john
output <- thr_test_het(data, 1, 2:5, 6)
output$f_test
output$p_value
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.