Skip to contents

Compute log rank test statistic on an endpoint.

Usage

fitLogrank(endpoint, placebo, data, ...)

Arguments

endpoint

character. Name of endpoint in data.

placebo

character. String of placebo in data$arm.

data

data frame. Usually it is a locked data.

...

subset condition that is compatible with dplyr::filter. survival::survdiff will be fitted on this subset only. This argument could be useful to create a subset of data for analysis when a trial consists of more than two arms. By default it is not specified, all data will be used to fit the model. More than one conditions can be specified in ..., e.g., fitLogrank('pfs', 'pbo', data, arm %in% c('pbo', 'low dose'), pfs > 0.5), which is equivalent to fitLogrank('pfs', 'pbo', data, arm %in% c('pbo', 'low dose') & pfs > 0.5).

Value

a data frame with three columns:

p

one-sided p-value for log rank test (alternative hypothesis: risk is higher in placebo arm).

info

the number of events of the endpoint in the subset.

z

the one-sided logrank statistics.