Learn R Programming

gsDesign2 (version 1.1.5)

s2pwe: Approximate survival distribution with piecewise exponential distribution

Description

Converts a discrete set of points from an arbitrary survival distribution to a piecewise exponential approximation.

Usage

s2pwe(times, survival)

Value

A tibble containing the duration and rate.

Arguments

times

Positive increasing times at which survival distribution is provided.

survival

Survival (1 - cumulative distribution function) at specified times.

Specification

The contents of this section are shown in PDF user manual only.

Examples

Run this code
# 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))

Run the code above in your browser using DataLab