View source: R/SampleSplitting.R
SMPLSplit_est | R Documentation |
A function for estimating the subsampled data.
SMPLSplit_est(data,dep,indep,th,plot,h=1,nonpar=2)
data |
the data in either data.frame or matrix. |
dep |
the name of dependent variable. |
indep |
the name(s) of independent variable(s). |
th |
the name of threshold variable. |
plot |
=1, plot; =0, do not plot. |
h |
h=1, heteroskedasticity-consistent covariance; h=0, homoskedastic case. |
nonpar |
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 to estimate regressions using an Epanechnikov kernel with automatic bandwidth. |
This code estimates the parameters of sub-sampled data. It generalizes the simple code of Dr. Hansen, allowing White Corrected Heteroskedastic Errors.
threshold |
values of threshold estimates. |
est0 |
coefficient estimates of global data. |
est.low |
coefficient estimates of low regime. |
est.high |
coefficient estimates of high regime. |
est0.info |
additional information of global data. |
est.joint.info |
additional information of joint threshods. |
est.low.info |
additional information of est.low. |
est.high.info |
additional information of est.high. |
Original code offered by Dr. B. E.Hansen (http://www.ssc.wisc.edu/~bhansen/).
Hanse B. E. (2000) Sample Splitting and Threshold Estimation. Econometrica, 68, 575-603.
## Not run, becasue of bootstrap replicaiton takes time. Users may unmark # and run.
data("dur_john")
rep <- 500
trim_per <- 0.15
dep <- "gdpGrowth"
indep <- colnames(dur_john)[c(2,3,4,5)]
SMPLSplit_est(data=dur_john,dep,indep,th="GDP60",plot=0,h=1,nonpar=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.