This function can be used to test the equality of the M critical points estimated from the respective levelspecific curves.
1 2 3 4 
formula 
An object of class 
data 
A data frame or matrix containing the model response variable
and covariates required by the 
na.action 
A function which indicates what should happen when the data contain 'NA's. The default is 'na.omit'. 
der 
Number which determines any inference process.
By default 
smooth 
Type smoother used: 
weights 
Prior weights on the data. 
nboot 
Number of bootstrap repeats. 
h0 
The kernel bandwidth smoothing parameter for the global effect (see references for more details at the estimation). Large values of the bandwidth lead to smoothed estimates; smaller values of the bandwidth lead lo undersmoothed estimates. By default, cross validation is used to obtain the bandwidth. 
h 
The kernel bandwidth smoothing parameter for the partial effects. 
nh 
Integer number of equallyspaced bandwidth on which the

kernel 
A character string specifying the desired kernel.
Defaults to 
p 
Degree of polynomial to be used. Its value must be the value of derivative + 1. The default value is 3 due to the function returns the estimation, first and second derivative. 
kbin 
Number of binning nodes over which the function is to be estimated. 
rankl 
Number or vector specifying the minimum value for the
interval at which to search the 
ranku 
Number or vector specifying the maximum value for the
interval at which to search the 
seed 
Seed to be used in the bootstrap procedure. 
cluster 
A logical value. If 
ncores 
An integer value specifying the number of cores to be used
in the parallelized procedure. If 
... 
Other options. 
localtest
can be used to test the equality of the
M critical points estimated from the respective levelspecific curves.
Note that, even if the curves and/or their derivatives are different, it is
possible for these points to be equal.
For instance, taking the maxima of the first derivatives into account, interest lies in testing the following null hypothesis
H_0: x_{01} = … = x_{0M}
versus the general alternative
H_1: x_{0i} \ne x_{0j} \quad {\rm{for}} \quad {\rm{some}} \quad \emph{i}, \emph{j} \in \{ 1, …, M\}.
The above hypothesis is true if d=x_{0j}x_{0k}=0 where
(j,k)= argmax \quad (l,m) \quad \{1 ≤q l<m ≤q M\} \quad x_{0l}x_{0m},
otherwise H_0 is false. It is important to highlight that, in practice, the true x_{0j} are not known, and consequently neither is d, so an estimate \hat d = \hat x_{0j}\hat x_{0k} is used, where, in general, \hat x_{0l} are the estimates of x_{0l} based on the estimated curves \hat m_l with l = 1, … , M.
Needless to say, since \hat d is only an estimate of the true d, the sampling uncertainty of these estimates needs to be acknowledged. Hence, a confidence interval (a,b) is created for d for a specific level of confidence (95%). Based on this, the null hypothesis is rejected if zero is not contained in the interval.
Note that if this hypothesis is rejected (and the factor has more than
two levels), one option could be to use the maxp.diff
function in
order to obtain the differences between each pair of factor's levels.
Note that the models fitted by localtest
function are specified
in a compact symbolic form. The \~ operator is basic in the formation
of such models. An expression of the form y ~ model
is interpreted as
a specification that the response y
is modelled by a predictor
specified symbolically by model
. The possible terms consist of a
variable name or a variable name and a factor name separated by : operator.
Such a term is interpreted as the interaction of the continuous variable and
the factor. However, if smooth = "splines"
, the formula is based on the function
formula.gam of the mgcv package.
The estimate of d value is returned and its confidence interval for a specificlevel of confidence, i.e. 95%. Additionally, it is shown the decision, accepted or rejected, of the local test. Based on the null hypothesis is rejected if a zero value is not within the interval.
Marta Sestelo, Nora M. Villanueva and Javier RocaPardinas.
Sestelo, M. (2013). Development and computational implementation of estimation and inference methods in flexible regression models. Applications in Biology, Engineering and Environment. PhD Thesis, Department of Statistics and O.R. University of Vigo.
1 2 3 4 5 6 
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.