Title: | Local Partial Likelihood Estimation and Simultaneous Confidence Band |
---|---|
Description: | Local partial likelihood estimation and simultaneous confidence band is a set of tools to test the covariates-biomarker interaction for survival data. Test for the covariates-biomarker interaction using the bootstrap method and the asymptotic method with simultaneous confidence band. |
Authors: | Bingshu Chen [aut, cre], Yicong Liu [aut], Siwei Zhang [aut], Teng Wen [aut] |
Maintainer: | Bingshu E. Chen <[email protected]> |
License: | GPL-2 |
Version: | 0.11 |
Built: | 2025-02-22 06:10:29 UTC |
Source: | https://github.com/statapps/lpl |
This package fits a multivariable local partial likelihood model for covariate-biomarker interaction with survival data.
"lpl" is a R package for multivariate covariate-biomarker interaction uisng local partial likelihood method.
Please use the following steps to install 'lpl' package:
1. First, you need to install the 'devtools' package. You can skip this step if you have 'devtools' installed in your R. Invoke R and then type
install.packages("devtools")
2. Load the devtools package.
library(devtools)
3. Install "lpl" package with R commond
install_github("statapps/lpl")
"lpl" uses local partial likelihood to etimate covariate-biomarker interactions and bootstrap method to test the significance of the interactions.
Siwei Zhang and Bingshu E. Chen
Maintainer: Bingshu E. Chen <[email protected]>
1. Fan, J., Lin, H,, Zhou, Y. (2006). Local partial-likelihood estimation for lifetime data. The Annals of Statistics. 34, 290-325.
2. Liu, Y., Jiang, W. and Chen, B. E. (2015). Testing for treatment-biomarker interaction based on local partial-likelihood. Statistics in Medicine. 34, 3516-3530.
3. Zhang, S., Jiang, W. and Chen, B. E. (2016). Estimate and test of multivariate covariates and biomarker interactions for survival data based on local partial likelihood. Manuscript in preparation.
coxph,
survival
# fit = lpl(y~trt+age+biomarker)
# fit = lpl(y~trt+age+biomarker)
Auxiliary function for lple
fitting.
Typically only used internally by 'lpl', but may be used to construct a control argument to either function.
# lpl.control(h, kernel = 'gaussian', B, w0, p1, pctl)
# lpl.control(h, kernel = 'gaussian', B, w0, p1, pctl)
h |
bandwidth of kernel function. The default value is h = 0.2 |
kernel |
kernel funtion types, including "gaussian", "epanechnikov", "rectangular", "triangular", "biweight", "cosine", "optcosine". The default value is 'gaussian' |
B |
number of bootstrap times. The default value is 200 |
w0 |
the estimated points in the interval of (0,1), select arbitrarily. The default value is seq(0.05, 0.95, 0.025) |
p1 |
the number of dependend variables that make interactions with the biomarker w. The default value is 1 |
pctl |
the estimated points that want to be shown in the output. The default value is seq(0.2, 0.8, 0.1) |
Control is used in model fitting of lpl.
This function checks the internal consisitency and returns a list of value as inputed to control model fit of lpl.
Siwei Zhang and Bingshu E. Chen
## The default control values are: h = 0.2, kernel = 'gaussian', B = 200, w0 = seq(0.05, 0.95, 0.025), p1 = 1, pctl = seq(0.2, 0.8, 0.1) ## ## To fit the lpl model with some control variables changed, w0=seq(0.03,0.97,by=2/100) ctl = lpl.control(w0=w0, h=0.3, p1=2, B=100) ## then fit the following model #fit = lpl(x, y, control = ctl)
## The default control values are: h = 0.2, kernel = 'gaussian', B = 200, w0 = seq(0.05, 0.95, 0.025), p1 = 1, pctl = seq(0.2, 0.8, 0.1) ## ## To fit the lpl model with some control variables changed, w0=seq(0.03,0.97,by=2/100) ctl = lpl.control(w0=w0, h=0.3, p1=2, B=100) ## then fit the following model #fit = lpl(x, y, control = ctl)
{lplb} is a R package for local partial likelihood estimation (LPLE) (Fan et al., 2006) of the coefficients of covariates with interactions of the biomarker W, and hypothesis test of whether the relationships between covariates and W are significant, by using bootstrap method.
## Default S3 method: lplb(x, y, control, ...) ## S3 method for class 'formula' lplb(formula, data=list(...), control = list(...), ...) # use # lplb(y ~ X1+X2+...+Xp+w, data=data, control) # # to fit a model with interactions between biomarker (w) with the first p1 # terms of dependent variables. # p1 is included in 'control'. p1<p. See 'lplb.control' for details # # use # lplb(x, y, control) # # to fit a model without the formula # # Biomarker w should be the 'LAST' dependend variable
## Default S3 method: lplb(x, y, control, ...) ## S3 method for class 'formula' lplb(formula, data=list(...), control = list(...), ...) # use # lplb(y ~ X1+X2+...+Xp+w, data=data, control) # # to fit a model with interactions between biomarker (w) with the first p1 # terms of dependent variables. # p1 is included in 'control'. p1<p. See 'lplb.control' for details # # use # lplb(x, y, control) # # to fit a model without the formula # # Biomarker w should be the 'LAST' dependend variable
formula |
an object of class "formula"(or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under 'Details'. |
data |
an optional data frame, list or environment (or object coercible by 'as.data.frame' to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula). |
x , y
|
For 'lplb.default', x is a design matrix of dimension n * (p+1) and y is a vector of observations of length n for a "Surv" object for "coxph". |
control |
a list of parameters for controlling the fitting process. See 'lplb.control' for details |
... |
additional arguments to be passed to the low level regression fitting functions (see below). |
Here 'w' is a Biomarker variable. This variable is required and shall be the last dependent variable in the formula.
'x.cdf' is a function that maps biomarker values to interval (0, 1) using its empirical cumulative distribution function.
lplb returns an object of class inheriting from "lplb" which inherits from the class 'coxph'. See later in this section.
The function "print" (i.e., "print.lplb") can be used to obtain or print a summary of the results.
An object of class "lplb" is a list containing at least the following components:
beta_w |
a matrix of m * p1, the estimated coefficients at each of the m estimated points, for the first p1 dependent variables with interactions of the biomarker w |
Q1 |
the test statistic of the data |
mTstar |
a vector of the test statistics from B times' bootstrap |
pvalue |
the p-value of the hypothesis that beta_w is a constant |
This package was build on code developed by Yicong Liu for simple treatment-biomaker interaction model.
Siwei Zhang and Bingshu E. Chen ([email protected])
Zhang, S., Jiang, W. and Chen, B. E. (2016). Estimate and test of multivariate covariates and biomarker interactions for survival data based on local partial likelihood. Manuscript in preparation.
coxph
,
lpl.control
print.lple
plot.lple
## fit1 = lplb(Surv(time, status)~z1 + z2 + w, data = dat, B = B, p1 = 2) ## print(fit1)
## fit1 = lplb(Surv(time, status)~z1 + z2 + w, data = dat, B = B, p1 = 2) ## print(fit1)
{lple} is a R package for local partial likelihood estimation (LPLE) (Fan et al., 2006) of the coefficients of covariates with interactions of the biomarker W, and hypothesis test of whether the relationships between covariates and W are significant, by using bootstrap method.
## Default S3 method: lple(x, y, control, ...) ## S3 method for class 'formula' lple(formula, data=list(...), control = list(...), ...) # use # lple(y ~ X1+X2+...+Xp+w, data=data, control) # # to fit a model with interactions between biomarker (w) with the first p1 # terms of dependent variables. # p1 is included in 'control'. p1<p. See 'lplb.control' for details # # use # lple(x, y, control) # # to fit a model without the formula # # Biomarker w should be the 'LAST' dependend variable
## Default S3 method: lple(x, y, control, ...) ## S3 method for class 'formula' lple(formula, data=list(...), control = list(...), ...) # use # lple(y ~ X1+X2+...+Xp+w, data=data, control) # # to fit a model with interactions between biomarker (w) with the first p1 # terms of dependent variables. # p1 is included in 'control'. p1<p. See 'lplb.control' for details # # use # lple(x, y, control) # # to fit a model without the formula # # Biomarker w should be the 'LAST' dependend variable
formula |
an object of class "formula"(or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under 'Details'. |
data |
an optional data frame, list or environment (or object coercible by 'as.data.frame' to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula). |
x , y
|
For 'lple.default', x is a design matrix of dimension n * (p+1) and y is a vector of observations of length n for a "Surv" object for "coxph". |
control |
a list of parameters for controlling the fitting process. See 'lplb.control' for details |
... |
additional arguments to be passed to the low level regression fitting functions (see below). |
Here 'w' is a Biomarker variable. This variable is required and shall be the last dependent variable in the formula.
'x.cdf' is a function that maps biomarker values to interval (0, 1) using its empirical cumulative distribution function.
lple returns an object of class inheriting from "lple" which inherits from the class 'coxph'. See later in this section.
The function "print" (i.e., "print.lple") can be used to obtain or print a summary of the results.
An object of class "lple" is a list containing at least the following components:
beta_w |
a matrix of m * p1, the estimated coefficients at each of the m estimated points, for the first p1 dependent variables with interactions of the biomarker w |
Q1 |
the test statistic of the data |
mTstar |
a vector of the test statistics from B times' bootstrap |
pvalue |
the p-value of the hypothesis that beta_w is a constant |
This package was build on code developed by Yicong Liu for simple treatment-biomaker interaction model.
Siwei Zhang and Bingshu E. Chen ([email protected])
Zhang, S., Jiang, W. and Chen, B. E. (2016). Estimate and test of multivariate covariates and biomarker interactions for survival data based on local partial likelihood. Manuscript in preparation.
coxph
,
lpl.control
print.lple
plot.lple
## fit1 = lple(Surv(time, status)~z1 + z2 + w, data = dat, B = B, p1 = 2) ## print(fit1)
## fit1 = lple(Surv(time, status)~z1 + z2 + w, data = dat, B = B, p1 = 2) ## print(fit1)
Draw a series of plots of beta_w vs. w_est for each dependent variable with interactions with the biomarker w. See also:
lple
,
lpl.control
## S3 method for class 'lple' plot(x, ..., scale = c('original', 'transformed'))
## S3 method for class 'lple' plot(x, ..., scale = c('original', 'transformed'))
x |
a lple class returned from lple fit. |
scale |
choose the scale of biomarker variable, 'original' or 'o' for the original biomarker scale. 'transformed' or 't' for transformed scale that mapps biomarker to interval (0, 1). The default is to plot in the original scale. |
... |
other options used in plot(). |
plot.lple is called to plot the relationships between beta_w and w_est for each dependent variable with interactions with the biomarker w, from the lple
fit model.
The number of interaction terms can be set in lpl.control
.
The default method, print.default has its own help page. Use methods("print") to get all the methods for the print generic.
Bingshu E. Chen and Siwei Zhang
lplb
,
lple
,
lpl.control
,
print.lple
# # fit = lplb(y ~ x) # plot(fit) #
# # fit = lplb(y ~ x) # plot(fit) #
Compute fitted values and prediction error for a model fitted by lple
## S3 method for class 'lple' ## S3 method for class 'lple' predict(object, newdata, newy=NULL, ...) ## S3 method for class 'lple' residuals(object, type=c("martingale", "deviance"), ...)
## S3 method for class 'lple' ## S3 method for class 'lple' predict(object, newdata, newy=NULL, ...) ## S3 method for class 'lple' residuals(object, type=c("martingale", "deviance"), ...)
object |
a model object from the lple fit |
newdata |
optional new data at which to do predictions. If absent, predictions are for the dataframe used in the original fit |
newy |
optional new response data. Default is NULL |
type |
type of residuals, the default is a martingale residual |
... |
additional arguments affecting the predictions produced |
predict.lple is called to predict object from the lple model lple
.
The default method, predict has its own help page. Use methods("predict") to get all the methods for the predict generic.
predict.lple returns a list of predicted values, prediction error and residuals.
lp |
linear predictor of beta(w)*Z, where beta(w) is the fitted regression coefficient and Z is covariance matrix. |
risk |
risk score, exp(lp). When new y is provided, both lp and risk will be ordered by survival time of the new y. |
residuals |
martingale residuals of the prediction, if available. |
pe.mres |
prediction error based on martingale residual, if both new data and new y is provided. |
cumhaz |
cumulative hzard function. |
time |
time for cumulative hazard function. Time from new y will be used is provided |
Bingshu E. Chen
The default method for predict predict
,
For the Cox model prediction: predict.coxph
.
#survfit.lple
# fit = lple(y~x+z, data = dat) # predict(fit) #
# fit = lple(y~x+z, data = dat) # predict(fit) #
print are used to provide a short summary of lplb outputs.
## S3 method for class 'lplb' print(x, ...)
## S3 method for class 'lplb' print(x, ...)
x |
a lplb class returned from lplb fit |
... |
other options used in print() |
print.lplb is called to print object or summary of object from the lplb model lplb
.
The default method, print.default has its own help page. Use methods("print") to get all the methods for the print generic.
Siwei Zhand and Bingshu E. Chen
The default method for print print.default
,
lplb
# # print(fit) #
# # print(fit) #
print are used to provide a short summary of lple outputs.
## S3 method for class 'lple' print(x, ...)
## S3 method for class 'lple' print(x, ...)
x |
the results of a lple fit |
... |
other options used in print() |
print.lple is called to print object or summary of object from the lple model lple
.
The default method, print.default has its own help page. Use methods("print") to get all the methods for the print generic.
Siwei Zhand and Bingshu E. Chen
The default method for print print.default
,
lple
# # print(fit) #
# # print(fit) #
Computes the predicted survival function for a model fitted by (lple).
## S3 method for class 'lple' ## S3 method for class 'lple' survfit(formula, se.fit=TRUE, conf.int=.95, ...)
## S3 method for class 'lple' ## S3 method for class 'lple' survfit(formula, se.fit=TRUE, conf.int=.95, ...)
formula |
a fitted model from (lple) fit |
se.fit |
a logical value indicating whether standard errors shall be computed. Default is TRUE |
conf.int |
The level for a two-sided confidence interval on the survival curve. Default is 0.95 |
... |
other arguments to the specific method |
survfit.lple is called to compuate baseline survival function from the lple model lple
.
The default method, survfit has its own help page. Use methods("survfit") to get all the methods for the survfit generic.
survfit.lple returns a list of predicted baseline survival function, cumulative hazard function and residuals.
surv |
Predicted baseline survival function when beta(w) = 0. |
cumhaz |
Baseline cumulative hazard function, -log(surv). |
hazard |
Baseline hazard function. |
varhaz |
Variance of the baseline hazard. |
residuals |
Martingale residuals of the (lple) model. |
std.err |
Standard error for the cumulative hazard function, if se.fit = TRUE. |
See survfit
for more detail about other output values such as upper, lower, conf.type.
Confidence interval is based on log-transformation of survival function.
Bingshu E. Chen
The default method for survfit survfit
,
#survfit.lple
# # survfit(fit, se.fit = FALSE) #
# # survfit(fit, se.fit = FALSE) #