Given one or more right-continuous step functions of time, given by vector
`time`

and vector of matrix `stepf`

, this function evaluates the
step function(s) at a vector of new time points given by `newtime`

.
Typical application is when the step function is given by a non- or
semi-parametric estimated of cumulative hazard or survival function, and the
value of this function is required at a set of time points.

1 |

`time` |
A vector of time points at which the step function changes value |

`stepf` |
A vector (of the same length as |

`newtime` |
A vector of time points at which the step function(s) is/are to be evaluated |

`subst` |
A value that is substituted for elements of |

`to.data.frame` |
Determines whether the output is a data frame with the
new time points and the values of the step function(s) (if |

The argument `time`

should be ordered, and not contain duplicated or
+/- Inf, and should be of the same length as `stepf`

. There are no
restrictions on ordering or duplicates of `newtime`

. For elements of
`newtime`

that are smaller than the minimum of `time`

, the value
of `subst`

is substituted.

Either a vector/matrix containing the step function(s) evaluated at
the new time points (if `to.data.frame=FALSE`

(default)), or a data
frame with column vectors `newtime`

containing the new time points and
`res`

containing the step function evaluated at the new time points (if
`to.data.frame=TRUE`

)

Hein Putter H.Putter@lumc.nl

1 2 3 4 5 6 | ```
tm <- c(0.2,0.5,1,1.2,1.8,4)
ta <- 2*tm
data.frame(time=tm, stepf=ta)
evalstep(time=tm, stepf=ta, newtime=c(0,0.2,0.3,0.6,1,1.5,3,4,5,0.1), subst=0)
evalstep(time=tm, stepf=data.frame(ta=ta,ta2=1/ta),
newtime=c(0,0.2,0.3,0.6,1,1.5,3,4,5,0.1), subst=0)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.