"vitality.fit"<- function(time,sdata,rc.data=F,se=F,gfit=F,datatype="CUM",ttol=.000001,init.params=F, pplot=T,tlab="days",lplot=T,cplot=F,silent=F) # # # # Vitality based survival model: parameter fitting routine: VERSION: 2/17/2004 # # REQUIRED PARAMETERS: # time - time component of data: time from experiment start. Time should # start after the imposition of a stressor is completed. # sdata - survival or mortality data. The default expects cumulative # survival fraction. If providing incremental mortality fraction # instead, use option: datatype="INC". # The default also expects the data to represent full mortality. # Otherwise, use option: rc.data=T to indicate right censored data. # # OPTIONAL PARAMETERS: # rc.data =T - specifies Right Censored data. If the data does not # represent full mortality, it is probably right censored. The default # is rc.data=F. A third option is rc.data="TF". Use this case to add # a near-term zero survival point to data which displays nearly full # mortality ( <.01 survival at end). If rc.data=F but the data does # not show full mortality, rc.data="TF" will be # invoked automatically. # se = calculates the standard errors for the MLE parameters. # Default is se=F. The initial study population is necessary for # computing these standard errors. # gfit = provides a Pearson C type test for goodness of fit. # Default is gfit=F. The initial study population is necessary for # computing goodness of fit. # datatype ="CUM" -cumulative survival fraction data- is the default. # Other option: datatype="INC" - for incremental mortality fraction # data. ttol (stopping criteria tolerence.) Default is .000001 . # specify as ttol=.0001. # If one of the liklihood plots (esp. for "k") does not look optimal, # try decreasing ttol. If the program crashes, try increasing ttol. # init.params =F has the routine choose initial parameter estimates for # r,s,k (default: =F). If you wish to specify initial param values # rather than have the routine choose them, specify # init.params=c(r,s,k) in that order (eg. init.params=c(.1,.02,.003)). # pplot =T provides plots of cumulative survival and incremental mortality - # for both data and fitted curves (default: =T). pplot=F provides no # plotting. A third option: pplot=n (n>=1) extends the time axis of # the fitting plots (beyond the max time in data). For example: # pplot=1.2 extends the time axis by 20%. (Note: the incremental # mortality plot is a continuous representation of the appropriately- # binned histogram of incremental mortalities.) # tlab ="