lazyhazplots: ~~function to do ... ~~

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

1
lazyhazplots(ts, pars, ints, cols = rainbow(length(ts)), xlim = NULL, add = F, main = "")

Arguments

ts

~~Describe ts here~~

pars

~~Describe pars here~~

ints

~~Describe ints here~~

cols

~~Describe cols here~~

xlim

~~Describe xlim here~~

add

~~Describe add here~~

main

~~Describe main here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use

comp1

Description of 'comp1'

comp2

Description of 'comp2'

...

Note

~~further notes~~

~Make other sections like Warning with Warning .... ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function(ts,pars,ints,cols=rainbow(length(ts)),xlim=NULL,add=F,main=""){
	mnt<-mnx<-mx<-c(); 
	for(j in ts){
		mx<-c(mx,max(j$ux,na.rm=T)); mnx<-c(mnx,min(j[j$ux>0,]$ux,na.rm=T));}
	mnt<-match(T,ts[[which.max(ints)]]$ux>0)
	mx<-max(mx); mnx<-min(mnx); if(is.null(xlim)){xrng<-c(mnt,max(ts[[which.min(ints)]]$time));}else{
		xrng<-c(10,xlim);}
	#print(xrng);
	if(add){points(1+ts[[1]]$time,ts[[1]]$ux,pch=3,col=cols[1]);} else {
		plot(1+ts[[1]]$time,ts[[1]]$ux,log='xy',type='p', pch=3,
			xlim=xrng,ylim=c(mnx,mx),xlab="Time",ylab="Hazard Rate",col=cols[1],main=main);
	} 
	lines(1:xrng[2],srvhaz(1:xrng[2],pars[1,1],pars[1,2],i=ints[1]),col=cols[1],lty=2);
	lines(1:xrng[2],srvhaz(1:xrng[2],pars[2,1],pars[2,2],pars[2,3],i=ints[1]),col=cols[1],lty=1);
	xrng<-xrng[1]:xrng[2];
	if(length(ts)>1){
		for(j in 2:length(ts)){
		points(1+ts[[j]]$time,ts[[j]]$ux,col=cols[j],pch=3); 
			lines(1:xrng[2],ints[j]*srvhaz(1:xrng[2],pars[1,1],pars[1,2],i=ints[j]),col=cols[j],lty=2);
			lines(1:xrng[2],ints[j]*srvhaz(1:xrng[2],pars[2,1],pars[2,2],pars[2,3],i=ints[j]),col=cols[j],lty=1);
		}
	}
  }

Survomatic documentation built on May 2, 2019, 4:09 p.m.