Title: | Continuous and Dichotomized Index Predictors Based on Distribution Quantiles |
---|---|
Description: | Select optimal functional regression or dichotomized quantile predictors for survival/logistic/numeric outcome and perform optimistic bias correction for any optimally dichotomized numeric predictor(s), as in Yi, et. al. (2023) <doi:10.1016/j.labinv.2023.100158>. |
Authors: | Tingting Zhan [aut, cre, cph] , Misung Yi [aut, cph] , Inna Chervoneva [aut, cph] |
Maintainer: | Tingting Zhan <[email protected]> |
License: | GPL-2 |
Version: | 0.1.7 |
Built: | 2024-12-15 07:47:23 UTC |
Source: | CRAN |
Continuous and dichotomized index predictors based on distribution quantiles.
Maintainer: Tingting Zhan [email protected] (ORCID) [copyright holder]
Authors:
Misung Yi [email protected] (ORCID) [copyright holder]
Inna Chervoneva [email protected] (ORCID) [copyright holder]
Selection of optimal quantile protein biomarkers based on cell-level immunohistochemistry data. Misung Yi, Tingting Zhan, Amy P. Peck, Jeffrey A. Hooke, Albert J. Kovatich, Craig D. Shriver, Hai Hu, Yunguang Sun, Hallgeir Rui and Inna Chervoneva. BMC Bioinformatics, 2023. doi:10.1186/s12859-023-05408-8
Quantile index biomarkers based on single-cell expression data. Misung Yi, Tingting Zhan, Amy P. Peck, Jeffrey A. Hooke, Albert J. Kovatich, Craig D. Shriver, Hai Hu, Yunguang Sun, Hallgeir Rui and Inna Chervoneva. Laboratory Investigation, 2023. doi:10.1016/j.labinv.2023.100158
### Data Preparation library(survival) data(Ki67, package = 'Qindex.data') Ki67c = within(Ki67[complete.cases(Ki67), , drop = FALSE], expr = { marker = log1p(Marker); Marker = NULL PFS = Surv(RECFREESURV_MO, RECURRENCE) }) (npt = length(unique(Ki67c$PATIENT_ID))) # 592 ### Step 1: Cluster-Specific Sample Quantiles Ki67q = clusterQp(marker ~ . - tissueID - inner_x - inner_y | PATIENT_ID, data = Ki67c) stopifnot(is.matrix(Ki67q$marker)) head(Ki67q$marker, n = c(4L, 6L)) set.seed(234); id = sort.int(sample.int(n = npt, size = 480L)) Ki67q_0 = Ki67q[id, , drop = FALSE] # training set Ki67q_1 = Ki67q[-id, , drop = FALSE] # test set ### Step 2 (after Step 1) ## Step 2a: Linear Sign-Adjusted Quantile Indices (fr = Qindex(PFS ~ marker, data = Ki67q_0)) stopifnot(all.equal.numeric(c(fr), predict(fr))) integrandSurface(fr) integrandSurface(fr, newdata = Ki67q_1) ## Step 2b: Non-Linear Sign-Adjusted Quantile Indices (nlfr = Qindex(PFS ~ marker, data = Ki67q_0, nonlinear = TRUE)) stopifnot(all.equal.numeric(c(nlfr), predict(nlfr))) integrandSurface(nlfr) integrandSurface(nlfr, newdata = Ki67q_1) ## view linear and non-linear sign-adjusted quantile indices together integrandSurface(fr, nlfr) ### Step 2c: Optimal Dichotomizing set.seed(14837); (m1 = optimSplit_dichotom( PFS ~ marker, data = Ki67q_0, nsplit = 20L, top = 2L)) predict(m1) predict(m1, boolean = FALSE) predict(m1, newdata = Ki67q_1) ### Step 3 (after Step 1 & 2) Ki67q_0a = within.data.frame(Ki67q_0, expr = { FR = std_IQR(fr) nlFR = std_IQR(nlfr) optS = std_IQR(marker[,'0.27']) }) Ki67q_1a = within.data.frame(Ki67q_1, expr = { FR = std_IQR(predict(fr, newdata = Ki67q_1)) nlFR = std_IQR(predict(nlfr, newdata = Ki67q_1)) optS = std_IQR(marker[,'0.27']) }) # `optS`: use the best quantile but discard the cutoff identified by [optimSplit_dichotom] # all models below can also be used on training data `Ki67q_0a` # naive use summary(coxph(PFS ~ NodeSt + Tstage + FR, data = Ki67q_1a)) summary(coxph(PFS ~ NodeSt + Tstage + nlFR, data = Ki67q_1a)) summary(coxph(PFS ~ NodeSt + Tstage + optS, data = Ki67q_1a)) # set.seed if necessary summary(BBC_dichotom(PFS ~ NodeSt + Tstage ~ FR, data = Ki67q_1a)) # `NodeSt`, `Tstage`: predctors to be used as-is # `FR` to be dichotomized # set.seed if necessary summary(BBC_dichotom(PFS ~ NodeSt + Tstage ~ nlFR, data = Ki67q_1a)) # set.seed if necessary summary(BBC_dichotom(PFS ~ NodeSt + Tstage ~ optS, data = Ki67q_1a)) # statistically rigorous # Option 1 summary(BBC_dichotom(PFS ~ NodeSt + Tstage ~ FR, data = Ki67q_1a)) # Option 2: summary(tmp <- BBC_dichotom(PFS ~ NodeSt + Tstage ~ FR, data = Ki67q_0a)) #coxph(PFS ~ NodeSt + Tstage + I(FR > attr(tmp, 'apparent_cutoff')), data = Ki67q_1a) coxph(PFS ~ NodeSt + Tstage + I(FR > matrixStats::colMedians(BBC_cutoff(tmp))), data = Ki67q_1a) # Option 1 and 2 are also applicable to `nlFR` and `optS`
### Data Preparation library(survival) data(Ki67, package = 'Qindex.data') Ki67c = within(Ki67[complete.cases(Ki67), , drop = FALSE], expr = { marker = log1p(Marker); Marker = NULL PFS = Surv(RECFREESURV_MO, RECURRENCE) }) (npt = length(unique(Ki67c$PATIENT_ID))) # 592 ### Step 1: Cluster-Specific Sample Quantiles Ki67q = clusterQp(marker ~ . - tissueID - inner_x - inner_y | PATIENT_ID, data = Ki67c) stopifnot(is.matrix(Ki67q$marker)) head(Ki67q$marker, n = c(4L, 6L)) set.seed(234); id = sort.int(sample.int(n = npt, size = 480L)) Ki67q_0 = Ki67q[id, , drop = FALSE] # training set Ki67q_1 = Ki67q[-id, , drop = FALSE] # test set ### Step 2 (after Step 1) ## Step 2a: Linear Sign-Adjusted Quantile Indices (fr = Qindex(PFS ~ marker, data = Ki67q_0)) stopifnot(all.equal.numeric(c(fr), predict(fr))) integrandSurface(fr) integrandSurface(fr, newdata = Ki67q_1) ## Step 2b: Non-Linear Sign-Adjusted Quantile Indices (nlfr = Qindex(PFS ~ marker, data = Ki67q_0, nonlinear = TRUE)) stopifnot(all.equal.numeric(c(nlfr), predict(nlfr))) integrandSurface(nlfr) integrandSurface(nlfr, newdata = Ki67q_1) ## view linear and non-linear sign-adjusted quantile indices together integrandSurface(fr, nlfr) ### Step 2c: Optimal Dichotomizing set.seed(14837); (m1 = optimSplit_dichotom( PFS ~ marker, data = Ki67q_0, nsplit = 20L, top = 2L)) predict(m1) predict(m1, boolean = FALSE) predict(m1, newdata = Ki67q_1) ### Step 3 (after Step 1 & 2) Ki67q_0a = within.data.frame(Ki67q_0, expr = { FR = std_IQR(fr) nlFR = std_IQR(nlfr) optS = std_IQR(marker[,'0.27']) }) Ki67q_1a = within.data.frame(Ki67q_1, expr = { FR = std_IQR(predict(fr, newdata = Ki67q_1)) nlFR = std_IQR(predict(nlfr, newdata = Ki67q_1)) optS = std_IQR(marker[,'0.27']) }) # `optS`: use the best quantile but discard the cutoff identified by [optimSplit_dichotom] # all models below can also be used on training data `Ki67q_0a` # naive use summary(coxph(PFS ~ NodeSt + Tstage + FR, data = Ki67q_1a)) summary(coxph(PFS ~ NodeSt + Tstage + nlFR, data = Ki67q_1a)) summary(coxph(PFS ~ NodeSt + Tstage + optS, data = Ki67q_1a)) # set.seed if necessary summary(BBC_dichotom(PFS ~ NodeSt + Tstage ~ FR, data = Ki67q_1a)) # `NodeSt`, `Tstage`: predctors to be used as-is # `FR` to be dichotomized # set.seed if necessary summary(BBC_dichotom(PFS ~ NodeSt + Tstage ~ nlFR, data = Ki67q_1a)) # set.seed if necessary summary(BBC_dichotom(PFS ~ NodeSt + Tstage ~ optS, data = Ki67q_1a)) # statistically rigorous # Option 1 summary(BBC_dichotom(PFS ~ NodeSt + Tstage ~ FR, data = Ki67q_1a)) # Option 2: summary(tmp <- BBC_dichotom(PFS ~ NodeSt + Tstage ~ FR, data = Ki67q_0a)) #coxph(PFS ~ NodeSt + Tstage + I(FR > attr(tmp, 'apparent_cutoff')), data = Ki67q_1a) coxph(PFS ~ NodeSt + Tstage + I(FR > matrixStats::colMedians(BBC_cutoff(tmp))), data = Ki67q_1a) # Option 1 and 2 are also applicable to `nlFR` and `optS`
Multivariable regression model with bootstrap-based optimism correction on the dichotomized predictors.
BBC_dichotom(formula, data, ...) optimism_dichotom(fom, X, data, R = 100L, ...) coef_dichotom(fom, X., data)
BBC_dichotom(formula, data, ...) optimism_dichotom(fom, X, data, R = 100L, ...) coef_dichotom(fom, X., data)
formula |
formula, e.g., |
data |
|
... |
additional parameters, currently not in use |
fom |
formula, e.g., |
X |
numeric matrix of |
R |
positive integer scalar,
number of bootstrap replicates |
X. |
Function BBC_dichotom obtains a multivariable regression model with bootstrap-based optimism correction on the dichotomized predictors. Specifically,
Obtain the dichotomizing rules of predictors
based on response
(via m_rpartD).
Multivariable regression (with additional predictors
, if any)
with dichotomized predictors
(via helper function coef_dichotom)
is the apparent performance.
Obtain the bootstrap-based optimism based on copies of bootstrap samples (via helper function optimism_dichotom).
The median of bootstrap-based optimism over
bootstrap copies
is the optimism-correction of the dichotomized predictors
.
Subtract the optimism-correction (in Step 2) from the apparent performance estimates (in Step 1),
only for .
The apparent performance estimates for additional predictors
's, if any, are not modified.
Neither the variance-covariance (vcov) estimates
nor the other regression diagnostics, e.g.,
residuals,
logLikelihood,
etc.,
of the apparent performance are modified for now.
This coefficient-only, partially-modified regression model is
the optimism-corrected performance.
Function BBC_dichotom returns a coxph, glm or lm regression model, with attributes,
attr(,'optimism')
the returned object from optimism_dichotom
attr(,'apparent_cutoff')
a double vector,
cutoff thresholds for the predictors in the apparent model
Helper function optimism_dichotom computes the bootstrap-based optimism of the dichotomized predictors. Specifically,
copies of bootstrap samples are generated. In the
-th bootstrap sample,
obtain the dichotomizing rules of predictors
based on response
(via m_rpartD)
multivariable regression (with additional predictors , if any) coefficient estimates
of
the dichotomized predictors
(via coef_dichotom)
are the bootstrap performance estimate.
Dichotomize in the entire data using each of the bootstrap rules
.
Multivariable regression (with additional predictors
, if any) coefficient estimates
of
the dichotomized predictors
(via coef_dichotom)
are the test performance estimate.
Difference between the bootstrap and test performance estimates,
an matrix of
minus
another
matrix of
,
are the bootstrap-based optimism.
'sHelper function coef_dichotom
fits a multivariable Cox proportional hazards (coxph) model for Surv response,
logistic (glm) regression model for logical response,
or linear (lm) regression model for gaussian response,
with
the dichotomized predictors as well as
the additional predictors
's.
It is almost inevitable to have duplicates among the dichotomized predictors .
In such case, the multivariable model is fitted using the unique
's.
Helper function optimism_dichotom returns an double matrix of
bootstrap-based optimism,
with attributes
attr(,'cutoff')
an double matrix,
the
copies of bootstrap cutoff thresholds for the
predictors.
See attribute
'cutoff'
of function m_rpartD
Helper function coef_dichotom returns a double vector of
the regression coefficients of dichotomized predictors 's, with attributes
In the case of duplicated 's, the regression coefficients of the unique
's are duplicated for those duplicates in
's.
Ewout W. Steyerberg (2009) Clinical Prediction Models. doi:10.1007/978-0-387-77244-8
Frank E. Harrell Jr., Kerry L. Lee, Daniel B. Mark. (1996) Multivariable prognostic models: issues in developing models, evaluating assumptions and adequacy, and measuring and reducing errors. doi:10.1002/(SICI)1097-0258(19960229)15:4<361::AID-SIM168>3.0.CO;2-4
library(survival) data(flchain, package = 'survival') # see more details from ?survival::flchain head(flchain2 <- within.data.frame(flchain, expr = { mgus = as.logical(mgus) })) dim(flchain3 <- subset(flchain2, futime > 0)) # required by ?rpart::rpart dim(flchain_Circulatory <- subset(flchain3, chapter == 'Circulatory')) m1 = BBC_dichotom(Surv(futime, death) ~ age + sex + mgus ~ kappa + lambda, data = flchain_Circulatory, R = 1e2L) summary(m1) matrixStats::colMedians(BBC_cutoff(m1)) # median bootstrap cutoff attr(m1, 'apparent_cutoff')
library(survival) data(flchain, package = 'survival') # see more details from ?survival::flchain head(flchain2 <- within.data.frame(flchain, expr = { mgus = as.logical(mgus) })) dim(flchain3 <- subset(flchain2, futime > 0)) # required by ?rpart::rpart dim(flchain_Circulatory <- subset(flchain3, chapter == 'Circulatory')) m1 = BBC_dichotom(Surv(futime, death) ~ age + sex + mgus ~ kappa + lambda, data = flchain_Circulatory, R = 1e2L) summary(m1) matrixStats::colMedians(BBC_cutoff(m1)) # median bootstrap cutoff attr(m1, 'apparent_cutoff')
Sample quantiles in each cluster of observations.
clusterQp( formula, data, f_sum_ = mean.default, probs = seq.int(from = 0.01, to = 0.99, by = 0.01), ... )
clusterQp( formula, data, f_sum_ = mean.default, probs = seq.int(from = 0.01, to = 0.99, by = 0.01), ... )
formula |
formula,
including response
|
data |
|
f_sum_ |
function to summarize the sample quantiles from
lower-level cluster |
probs |
double vector,
probabilities |
... |
additional parameters of function quantile |
Function clusterQp returns an aggregated data.frame, in which
the highest cluster and cluster-specific covariate(s)
's
are retained.
If the input formula
takes form of y ~ . | c1
or y ~ . - z1 | c1
,
then all covariates (except for ) are considered cluster-specific;
Sample quantiles from lower-level clusters (e.g., ) are point-wise summarized using function
f_sum_
.
response is removed; instead, a double matrix of
columns stores
the cluster-specific sample quantiles.
This matrix
is named after the parsed expression of response in
formula
;
colnames are the probabilities , for the ease of subsequent programming.
# see ?`Qindex-package` for examples
# see ?`Qindex-package` for examples
An interactive htmlwidgets of the perspective plot for Qindex model(s) using package plotly.
integrandSurface( ..., newdata = data, proj_Q_p = TRUE, proj_S_p = TRUE, proj_beta = TRUE, n = 501L, newid = seq_len(min(50L, .row_names_info(newdata, type = 2L))), qlim = range(X, newX), axis_col = c("dodgerblue", "deeppink", "darkolivegreen"), beta_col = "purple", surface_col = c("white", "lightgreen") )
integrandSurface( ..., newdata = data, proj_Q_p = TRUE, proj_S_p = TRUE, proj_beta = TRUE, n = 501L, newid = seq_len(min(50L, .row_names_info(newdata, type = 2L))), qlim = range(X, newX), axis_col = c("dodgerblue", "deeppink", "darkolivegreen"), beta_col = "purple", surface_col = c("white", "lightgreen") )
... |
one or more Qindex models based on a same training set. |
newdata |
data.frame, with at least
the response |
proj_Q_p |
logical scalar, whether to show
the projection of |
proj_S_p |
logical scalar, whether to show
the projection of |
proj_beta |
logical scalar, whether to show
|
n |
integer scalar, fineness of visualization,
default |
newid |
integer scalar or vector,
row indices of |
qlim |
length-2 double vector,
range on |
axis_col |
|
beta_col |
character scalar, color
of |
surface_col |
length-2 character vector, color of the integrand surface(s), for lowest and highest surface values |
Function integrandSurface returns a pretty htmlwidgets created by R package plotly
to showcase the perspective plot of the
estimated sign-adjusted integrand surface .
If a set of training/test subjects is selected (via parameter newid
), then
the estimated sign-adjusted line integrand curve
of subject
is displayed on the surface
;
the quantile curve
is projected on the
-plain of the 3-dimensional
cube,
if
proj_Q_p=TRUE
(default);
the user-specified is marked on the
-plain of the 3D cube,
if
proj_Q_p=TRUE
(default);
is projected on the
-plain of the 3-dimensional
cube,
if one and only one Qindex model is provided in in
put argument
...
and proj_S_p=TRUE
(default);
the estimated linear functional coefficient is shown on the
-plain of the 3D cube,
if one and only one linear Qindex model is provided in input argument
...
and proj_beta=TRUE
(default).
The quantile index (QI),
with a linear functional coefficient
can be estimated by fitting a functional generalized linear model (FGLM, James, 2002) to exponential-family outcomes,
or by fitting a linear functional Cox model (LFCM, Gellar et al., 2015) to survival outcomes.
More flexible non-linear quantile index (nlQI)
with a bivariate twice differentiable function
can be estimated by fitting a functional generalized additive model (FGAM, McLean et al., 2014) to exponential-family outcomes,
or by fitting an additive functional Cox model (AFCM, Cui et al., 2021) to survival outcomes.
The estimated integrand surface of quantile indices and non-linear quantile indices, defined on
and
for all training subjects
,
is
Ideally, we would wish that, in the training set, the estimated linear and/or non-linear quantile indices
be positively correlated with a more intuitive quantity, e.g., quantiles at a user-specified
, for the interpretation of downstream analysis,
Therefore, we define the sign-adjustment term
as the sign of the correlation between
the estimated quantile index
and the quantile
,
for training subjects
.
The estimated sign-adjusted integrand surface is
.
The estimated sign-adjusted quantile indices
are positively correlated with subject-specific sample medians
(default
) in the training set.
The maintainer is not aware of any functionality of projection of arbitrary curves in package plotly.
Currently, the projection to -plain is hard coded on
-plain.
James, G. M. (2002). Generalized Linear Models with Functional Predictors, doi:10.1111/1467-9868.00342
Gellar, J. E., et al. (2015). Cox regression models with functional covariates for survival data, doi:10.1177/1471082X14565526
Mathew W. M., et al. (2014) Functional Generalized Additive Models, doi:10.1080/10618600.2012.729985
Cui, E., et al. (2021). Additive Functional Cox Model, doi:10.1080/10618600.2020.1853550
# see ?`Qindex-package`
# see ?`Qindex-package`
To identify the optimal dichotomizing predictors using repeated sample splits.
optimSplit_dichotom( formula, data, include = quote(p1 > 0.15 & p1 < 0.85), top = 1L, nsplit, ... ) split_dichotom(y, x, id, ...) splits_dichotom(y, x, ids = rSplit(y, ...), ...) ## S3 method for class 'splits_dichotom' quantile(x, probs = 0.5, ...)
optimSplit_dichotom( formula, data, include = quote(p1 > 0.15 & p1 < 0.85), top = 1L, nsplit, ... ) split_dichotom(y, x, id, ...) splits_dichotom(y, x, ids = rSplit(y, ...), ...) ## S3 method for class 'splits_dichotom' quantile(x, probs = 0.5, ...)
formula , y , x
|
formula, e.g., |
data |
|
include |
(optional) language, inclusion criteria.
Default |
top |
positive integer scalar, number of optimal dichotomizing predictors, default |
nsplit , ...
|
additional parameters for function rSplit |
id |
logical vector for helper function split_dichotom, indices of training ( |
ids |
(optional) list of logical vectors for helper function splits_dichotom, multiple copies of indices of repeated training-test sample splits. |
probs |
double scalar for helper function quantile.splits_dichotom, see quantile |
Function optimSplit_dichotom identifies the optimal dichotomizing predictors via repeated sample splits. Specifically,
Generate multiple, i.e., repeated, training-test sample splits (via rSplit)
For each candidate predictor , find the median-split-dichotomized regression model based on the repeated sample splits, see details in section Details on Helper Functions
Limit the selection of the candidate predictors 's to a user-desired range of
of the split-dichotomized regression models, see explanations of
in section Returns of Helper Functions
Rank the candidate predictors 's by the decreasing order of the absolute values of the regression coefficient estimate of the median-split-dichotomized regression models. On the top of this rank are the optimal dichotomizing predictors.
Function optimSplit_dichotom returns an object of class 'optimSplit_dichotom'
, which is a list of dichotomizing functions,
with the input formula
and data
as additional attributes.
Helper function split_dichotom performs a univariable regression model on the test set with a dichotomized predictor, using a dichotomizing rule determined by a recursive partitioning of the training set. Specifically, given a training-test sample split,
find the dichotomizing rule of the predictor
given the response
in the training set (via rpartD);
fit a univariable regression model of the response with the dichotomized predictor
in the test set.
Currently the Cox proportional hazards (coxph) regression for Surv response, logistic (glm) regression for logical response and linear (lm) regression for gaussian response are supported.
Helper function splits_dichotom fits multiple split-dichotomized regression models split_dichotom on the response and predictor
, based on each copy of the repeated training-test sample splits.
Helper function quantile.splits_dichotom is a method dispatch of the S3 generic function quantile on splits_dichotom object. Specifically,
collect the univariable regression coefficient estimate from each one of the split-dichotomized regression models;
find the nearest-even (i.e., type = 3
) quantile of the coefficients from Step 1. By default, we use the median (i.e., prob = .5
);
the split-dichotomized regression model corresponding to the selected coefficient quantile in Step 2, is returned.
Helper function split_dichotom returns a split-dichotomized regression model, which is either a Cox proportional hazards (coxph), a logistic (glm), or a linear (lm) regression model, with additional attributes
attr(,'rule')
function, dichotomizing rule based on the training set
attr(,'text')
character scalar, human-friendly description of
attr(,'p1')
double scalar,
attr(,'coef')
double scalar, univariable regression coefficient estimate of
Helper function splits_dichotom returns a list of split-dichotomized regression models (split_dichotom).
Helper function quantile.splits_dichotom returns a split-dichotomized regression model (split_dichotom).
# see ?`Qindex-package`
# see ?`Qindex-package`
Regression models with optimal dichotomizing predictor(s), used either as boolean or continuous predictor(s).
## S3 method for class 'optimSplit_dichotom' predict( object, formula = attr(object, which = "formula", exact = TRUE), newdata = attr(object, which = "data", exact = TRUE), boolean = TRUE, ... )
## S3 method for class 'optimSplit_dichotom' predict( object, formula = attr(object, which = "formula", exact = TRUE), newdata = attr(object, which = "data", exact = TRUE), boolean = TRUE, ... )
object |
an optimSplit_dichotom object |
formula |
(optional) formula to specify the response in test data. If missing, the model formula of training data is used |
newdata |
(optional) test data.frame, candidate numeric predictors |
boolean |
logical scalar, whether to use the dichotomized predictor (default, |
... |
additional parameters, currently not in use |
Function predict.optimSplit_dichotom returns a list of regression models, coxph model for Surv response, glm for logical response, and lm model for numeric response.
# see ?`Qindex-package`
# see ?`Qindex-package`
To predict sign-adjusted quantile indices of a test set.
## S3 method for class 'Qindex' predict(object, newdata = object@gam$data, ...)
## S3 method for class 'Qindex' predict(object, newdata = object@gam$data, ...)
object |
an Qindex object based on the training set. |
newdata |
test data.frame, with at least
the response |
... |
additional parameters, currently not in use. |
Function predict.Qindex computes
the predicted sign-adjusted quantile indices on the test set,
which is
the product of function predict.gam return
and the correlation sign based on training set
(object@sign
, see Step 3 of section Details of function Qindex).
Multiplication by object@sign
is required to ensure
that the predicted sign-adjusted quantile indices
are positively associated with the training functional predictor values
at the selected tabulating grid.
Function predict.Qindex returns a double vector, which is the predicted sign-adjusted quantile indices on the test set.
Sign-adjusted quantile indices based on linear and/or nonlinear functional predictors.
Qindex(formula, data, sign_prob = 0.5, ...) Qindex_prefit_(formula, data, family, nonlinear = FALSE, ...)
Qindex(formula, data, sign_prob = 0.5, ...) Qindex_prefit_(formula, data, family, nonlinear = FALSE, ...)
formula |
formula, e.g., |
data |
data.frame, must be a returned object from function clusterQp |
sign_prob |
double scalar between 0 and 1,
user-specified probability |
... |
additional parameters for functions s and ti,
most importantly |
family |
|
nonlinear |
logical scalar,
whether to use nonlinear or linear functional model.
Default |
Function Qindex returns an Qindex object, which is an instance of an S4 class. See section Slots for details.
.Data
double vector, sign-adjusted quantile indices, see section Details of function integrandSurface
formula
see section Arguments, parameter formula
gam
a gam object
gpf
a 'gam.prefit'
object, which is the returned object
from function gam with argument fit = FALSE
p.value
numeric scalar,
-value for the test of significance of the functional predictor,
based on slot
@gam
sign
double scalar of either 1 or -1, sign-adjustment, see section Details of function integrandSurface
sign_prob
double scalar, section Arguments, parameter sign_prob
# see ?`Qindex-package`
# see ?`Qindex-package`