R/find.hazard.R

Defines functions find.hazard

Documented in find.hazard

find.hazard <- function(t, h.val, h.ranges, type, mode){

	if(type=="increasing"){
		h	<-	find.h.up(t, h.val, h.ranges)
		}
	if(type=="decreasing"){
		h	<-	find.h.down(t, h.val, h.ranges)
		}
	if(type=="unimodal"){
		if(t<mode){
		h	<-	find.h.up(t, h.val, h.ranges)
		}
		if(t>mode){
		h	<-	find.h.down(t, h.val, h.ranges)
		}
		if(t==mode){
		h	<-	Inf
		}}
	if(type=="ushaped"){
		if(t<mode){
		h	<-	find.h.down(t, h.val, h.ranges)
		}
		if(t>mode){
		h	<-	find.h.up(t, h.val, h.ranges)
		}
		if(t==mode){
		h	<-	0
		}}

	return(h)

	}

Try the CPHshape package in your browser

Any scripts or data that you put into this service are public.

CPHshape documentation built on May 30, 2017, 4:32 a.m.