nlFRindex {Qindex} | R Documentation |
Nonlinear Functional Regression Indices
Description
Functions explained in this documentation are,
nlFRindex()
-
to compute the non-linear functional regression indices based on the functional predictors.
predict.FRindex()
-
to compute the predicted values based on functional regression indices model.
Usage
nlFRindex(
formula,
data,
xarg = as.double(colnames(X)),
family,
fit = TRUE,
...
)
## S3 method for class 'nlFRindex'
predict(object, newdata, ...)
Arguments
formula |
a two-sided formula.
|
data |
data.frame, with
the response |
xarg |
numeric vector.
The default argument comes from the column names of the matrix of
tabulated functional predictor values
Otherwise, an error message will be returned. |
family |
.. |
fit |
|
... |
additional parameters, currently not in use |
object |
an nlFRindex object for the predict method,
the returned object from function |
newdata |
data.frame, with at least
the tabulated functional predictor values |
Details
Functional regression indices & weights model
Function nlFRindex()
fits a non-linear functional regression model to the response y
using the functional predictor X
,
with values tabulated on a same grid xarg
for all subjects (Cui et al, 2021).
Predict method for non-linear functional regression indices
Function predict.nlFRindex()
computes non-linear functional regression indices
based on the tabulated functional predictors X^{new}
in a new sets of subjects.
It's important that the new tabulation grid must be exactly the same
as the model tabulation grid object@xarg
.
Value
Functional regression indices & weights model
Function nlFRindex()
returns an S4 nlFRindex object.
The slots of S4 class nlFRindex are described in section Slots.
Predict method for non-linear functional regression indices
Function predict.nlFRindex()
returns a
double vector,
which is the predicted non-linear functional regression indices.
Slots
formula,data,xarg
see explanations in section Arguments
gam
gam object
p.value
numeric scalar,
p
-value for the test of significance of the functional predictorindex
References
Cui, E., Crainiceanu, C. M., & Leroux, A. (2021). Additive Functional Cox Model. Journal of Computational and Graphical Statistics. doi:10.1080/10618600.2020.1853550
Examples
pt = unique(Ki67$PATIENT_ID)
length(pt) # 622
# set.seed if necessary
train_pt = sample(pt, size = 500L)
Ki67q = clusterQp(Marker ~ ., data = Ki67, exclude = c('tissueID','inner_x','inner_y'))
train_q = subset(Ki67q, PATIENT_ID %in% train_pt)
test_q = subset(Ki67q, !(PATIENT_ID %in% train_pt))
train_q$Marker = log1p(train_q$Marker)
test_q$Marker = log1p(test_q$Marker)
# using Cox model
m = nlFRindex(Surv(RECFREESURV_MO, RECURRENCE) ~ Marker, data = train_q)
m@p.value # test significance of `Marker` as a functional predictor
train_index = predict(m, newdata = train_q) # non-linear FR index of training data
# stopifnot(identical(train_index, m@index))
predict(m, newdata = test_q) # non-linear FR index of test data
# using logistic regression model
nlFRindex(RECURRENCE ~ Marker, data = train_q)
# using Gaussian model
nlFRindex(RECFREESURV_MO ~ Marker, data = train_q)