optimal.cutpoint: Function to Find the First Cutpoint and its P Value

Description Usage Arguments Details Value References Examples

View source: R/optimal.cutpoint.R

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

1
2
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 [,,drop =F] to keep the data frame structure

method

argument for coxph function. Default is 'breslow'. See coxph for more details.

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 coxph for more details.

eps

argument for coxph function; default is 0.000001. See coxph for more details.

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 coxph fitted with 1) entire data, 2) data before the optimal cutpoint, and 3) data after the optimal cutpoint.

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

1
2
3
4
5
6
##Call in alcohol data set
data('alcohol')
require(survival)

coxtree <- optimal.cutpoint(alcohol[,'time'], alcohol[,'event'], 
                      x = alcohol[,'alc', drop = FALSE])

Example output

Loading required package: survival

TimeVTree documentation built on May 2, 2019, 2:17 a.m.