thr_est: Threshold Estimation

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/thr_est.R

Description

Computes estimates, standard errors, and confidence intervals of parameters in the threshold regression model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
thr_est(
  df,
  yi,
  xi,
  qi,
  h,
  test.pvalue,
  var.names = colnames(df),
  conf2 = 0.8,
  nonpar = 2,
  graph = TRUE,
  signif.level = "stars",
  inf.crit = FALSE,
  digits = 3,
  integer.digits = NULL,
  digits.thr = digits,
  header = NULL,
  output.short = FALSE,
  signif.legend = TRUE
)

Arguments

df

Data frame.

yi

Integer or character; index or column name of dependent (y) variable in df.

xi

Integer or character vector; indexes or column names of independent (x) variables in df.

qi

Integer or character; index or column name of threshold (q) variable in df.

h

Integer; heteroskedasticity indicator. Set h = 0 to impose homoskedasticity assumption; set h = 1 to use White-correction for heteroskedasticity.

test.pvalue

Numeric; p-value of the threshold test returned by thr_test_hom or thr_test_hom.

var.names

Character vector; variable names with length(var.names) == ncol(df) corresponding to columns in df to be used in threshold regression table. Default is colnames(df).

conf2

Numeric; confidence level for first step of two-step confidence regions for regression parameters. Default is conf2 = .8.

nonpar

Integer; indicator for non-parametric method used to estimate nuisance scale in the presence of heteroskedasticity (only relevant if h = 1). Set nonpar = 1 to estimate regressions using a quadratic; set nonpar= 2 (default) to estimate regressions using an Epanechnikov kernel with automatic bandwidth.

graph

Logical; graph indicator. Set TRUE (default) to view the graph of the concentrated likelihood in gamma; set FALSE otherwise.

signif.level

Character; indicator for notation of statistical significance levels. Set signif.level = "stars" (default) to use stars: *p < 0.1, **p < 0.05, ***p < 0.01. Set signif.level = "colors" to use red and blue tones for statistically significant positive and negative estimates, respectively. (see Note for LaTeX specification of red and blue tones.)

inf.crit

Logical; if TRUE, information criteria (AIC, BIC, HQC) for each regime are shown in threshold regression table. Default is FALSE.

digits

Integer; number of decimal places to be used for estimated coefficients in threshold regression table. Default is digits = 3. (Will be used in format(round(x, digits = digits), nsmall = digits), see format, round.)

integer.digits

Integer; number of integer digits (i.e. digits before the decimal point) to be used for estimated coefficients in threshold regression table. If NULL (default), maximum value will be inquired.

digits.thr

Integer; number of decimal places to be used for threshold estimate in threshold regression table. Default is digits.thr = digits. (See digits for usage.)

header

Character; header to be used in threshold regression table.

output.short

Logical; if FALSE (default), full output is printed. If TRUE, only threshold regression table is printed.

signif.legend

Logical; if TRUE (default), legend of significance levels is printed below threshold regression table.

Details

Do not include a constant in the independent variables; the function automatically adds an intercept to the regression.

Value

Least squares estimate of threshold parameter. Output is printed to console unless redirected to file with sink (see examples).

Note

  1. Load these packages in LaTeX file: \usepackage{booktabs} \usepackage[table]{xcolor} \usepackage{siunitx}.

  2. If signif.level = "colors", add these commands in LaTeX file to obtain red and blue tones: \newcommand{\RedA}{red} \newcommand{\RedB}{red!60} \newcommand{\RedC}{red!30} \newcommand{\BlueA}{blue!75} \newcommand{\BlueB}{blue!55} \newcommand{\BlueC}{blue!30}.

Author(s)

Marcel Kremer, marcel.kremer@uni-due.de

Bruce E. Hansen, behansen@wisc.edu

References

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.

See Also

thr_test_hom and thr_test_het for threshold tests under homoskedasticity and heteroskedasticity, respectively.

Examples

1
2
3
4
5
6
## Performs part of the empirical work reported in Hansen (2000)
data <- dur_john
test <- thr_test_het(data, 1, 2:5, 6)

qhat <- thr_est(data, 1, 2:5, 6, 1, test$p_value)
qhat

mlkremer/thrreg documentation built on May 8, 2021, 9 p.m.