s2pwe: Approximate survival distribution with piecewise exponential...

Description Usage Arguments Value Specification Examples

View source: R/s2pwe.R

Description

s2pwe converts a discrete set of points from an arbitrary survival distribution to a piecewise exponential approximation

Usage

1
s2pwe(times, survival)

Arguments

times

Positive increasing times at which survival distribution is provided.

survival

Survival (1 - cumulative distribution function) at specified times

Value

A tibble containing the duration and rate.

Specification

The contents of this section are shown in PDF user manual only.#' @return A tibble with duration and 'rate'

Examples

1
2
3
4
# Example: arbitrary numbers
s2pwe(1:9,(9:1)/10)
# Example: lognormal
s2pwe(c(1:6,9),plnorm(c(1:6,9),meanlog=0,sdlog=2,lower.tail=FALSE))

evettek/ek-test documentation built on Dec. 20, 2021, 6:47 a.m.