optimal.cutpoint {TimeVTree} | R Documentation |
Function to Find the First Cutpoint and its P Value
Description
This function finds the first optimal cutpoint for the time-varying regression effects based on the maximized score statistics and calculates p-value based on a formula from Davies (1987) and O'Quigley and Pessione (1991). This is for depth 1 only.
Usage
optimal.cutpoint(survtime, survstatus, x, method = "breslow", acpf = 10,
iter.max = 20, eps = 1e-06)
Arguments
survtime |
survival time/ follow up time of subjects |
survstatus |
survival status of subjects. 0 for censored and 1 for an event |
x |
a data frame of covariates. In case of a single covariate, use |
method |
argument for coxph function. Default is 'breslow'. See |
acpf |
The search for the optimal cutpoint starts from the ((acpf/2)+1)th event until the (k - (acpf/2))th event, where k is the total number of events. Default is 10. |
iter.max |
the maximum number of iteration in coxph; default is 20. See |
eps |
argument for coxph function; default is 0.000001. See |
Details
optimal.cutpoint
takes in survival time, survival status, and covariates to find the first optimal cutpoint.
Currently, data need to be arranged in descending order of time and with no missing.
Value
optimal.cutpoint
returns the following information:
breakpt |
optimal cutpoint |
scoretest |
Maximum score associated with the optimal cut point |
summary |
3 output from |
pvalue |
p-value to test the existance of a change point against none |
References
Davies, R. (1987). Hypothesis Testing when a Nuisance Parameter is Present Only Under the Alternatives. Biometrika, 74(1), 33-43.
O'Quigley, J., and Pessione, F. (1991). The Problem of a Covariate-Time Qualitative Interaction in a Survival Study. Biometrics, 47(1), 101-115.
Examples
##Call in alcohol data set
data('alcohol')
require(survival)
coxtree <- optimal.cutpoint(alcohol[,'time'], alcohol[,'event'],
x = alcohol[,'alc', drop = FALSE])