Testing the shape of a functional coefficient in the median and/or the variabilty function
Testing the shape of a functional coefficient in the median and/or the variabilty function
Testing a functional coefficient of a covariate in the median and/or the variability function, considering the general hetersocedastic varying-coefficient model in Gijbels etal (2017a). [REMOVE_ME]Y(t)=∑k=0pβk(t)X(k)(t)+γ(t)exp(∑k=1pθk(t)X(k)(t))ϵ(t).[REMOVEME2]
Description
Testing a functional coefficient of a covariate in the median and/or the variability function, considering the general hetersocedastic varying-coefficient model in Gijbels etal (2017a).
X: The covariates, containing 1 as its first component (including intercept in the model).
y: The response vector.
d: The order of differencing operator for each covariate.
kn: The number of knot intervals for each covariate.
degree: The degree of B-spline basis for each covariate.
lambda: The grid of smoothing parameter to control the trade between fidelity and penalty term (use a fine grid of lambda).
gam: The power used in estimating the smooting parameter for each covariate (e.g. gam=1 or gam=0.5).
v: The covariate indicator for which the shape test is interested.
nr.bootstrap.samples: The number of bootstrap samples used.
seed: The seed for the random generator in the bootstrap resampling.
test: The requested type of testing, it consists two arguments: the first argument for median and the second for the variability function. "c" stands for constancy, "m" stands for monotonicity, and "conv" stands for convexity. insert NA to the other argument when only for median/ variability function is needed..
omega: A user defined constraint parameter for monotonicity or convexity (in Equation (7) of Gijbels etal (2017a)), chosen as large as possible.
Returns
result: The testing procedures.
P: The p-values.
GR: The test statistics for the given data.
Gb: The bootstrap test statistics.
References
Andriyana, Y. and Gijbels, I. & Verhasselt, A. (2014). P-splines quantile regression estimation in varying coefficient models. Test, 23, 153-194.
Andriyana, Y., Gijbels, I. and Verhasselt, A. (2017). Quantile regression in varying-coefficient models: non-crossing quantile curves and heteroscedasticity. Statistical Papers, DOI:10.1007/s00362-016-0847-7
Gijbels, I., Ibrahim, M. A., and Verhasselt, A. (2017a). Shape testing in quantile varying coefficient models with heteroscedastic error. Journal of Nonparametric Statistics, 29(2):391-406.
Gijbels, I., Ibrahim, M. A., and Verhasselt, A. (2017b). Testing the heteroscedastic error structure in quantile varying coefficient models. The Canadian Journal of Statistics, DOI:10.1002/cjs.11346.
He, X. (1997). Quantile curves without crossing. The American Statistician, 51, 186-192.
Author(s)
Mohammed Abdulkerim Ibrahim
Note
Some warning messages are related to the function rq.fit.sfn.
See Also
rq.fit.sfn
as.matrix.csr
truncSP
Examples
data(wages)y = wages$resp ## the hourly wagetimes = wages$exper ## the duration of work experience in yearssubj = wages$id ## subject indicator (individual)dim=length(y)## number of rows in the data = 6402x0 = rep(1,dim)## for intercept### the covariates## creating 2 dummy variables for the race covariatewages$r1[wages$race=="black"]=1wages$r1[wages$race!="black"]=0wages$r2[wages$race=="hisp"]=1wages$r2[wages$race!="hisp"]=0x1 = wages$r1 # stands for blackx2 = wages$r2 # stands for hispanicx3 = wages$hgc ## the highest grade completed by the indiviadualX = cbind(x0, x1, x2, x3)## the covariate matrixpx=ncol(X)############################# Input parameters #############################lambda =1# we used 10^seq(-2, 1, 0.1) in Gijbels etal (2017a)kn = rep(1,px)# used rep(5,px) in Gijbels etal (2017a)degree = rep(2,px)# the degree of splinesd = rep(1,px)gam=0.25nr.bootstrap.samples=2# used 200 in Gijbels etal (2017a)seed=110#########################test1=simul_shapetest(times=times, subj=subj, X=X, y=y, d=d, kn=kn, degree=degree, lambda=lambda, gam=gam, v=1, nr.bootstrap.samples=nr.bootstrap.samples,seed=seed, test=c("c",NA),omega=10^3)#### Testing resultstest1$result #the testing procedurestest1$P ## p-valuestest1$R ## test statistics