Description Usage Arguments Value Author(s) Examples
This function for calculating the test statistics and p-value by wild bootstrap.
| 1 | cterTest(y, x, z, tau = 0.5, NB = 1000)
 | 
| y | A vector of response | 
| x | A scalar covariate with threshold | 
| z | A vector of covariates | 
| tau | the expectile level, 0.5 for default | 
| NB | resampling times, 1000 for default | 
A list with the elements
| Tn | The statistic based on original data. | 
| Tn.NB | The statistics by wild bootstrap. | 
| p.value | The p-value by wild bootstrap. | 
Feipeng Zhang and Qunhua Li
| 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 | ## simulated data
ptm <- proc.time()
set.seed(1)
n <- 200
t0 <- 1.5
bet0 <- c(1, 3, 0, 1)
tau <- 0.3
modtype <- 1
errtype <- 1
dat <- cterSimData(n, bet0, t0, tau, modtype, errtype)
y <- dat[, 1]
x <- dat[, 2]
z <- dat[, 3]
fit.test <- cterTest(y, x, z, tau, NB = 30)
fit.test$p.value
## The example of Baseball pitcher salary
data(data_bbsalaries)
y <- data_bbsalaries$y
x <- data_bbsalaries$x
z <- NULL
tau <- 0.5
fit.test <- cterTest(y, x, z, tau, NB = 30)
fit.test$p.value
proc.time() - ptm
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.