Last data update: 2014.03.03

R: Maximum values of s for which the IDP test returns a...
isurvdiff.smaxR Documentation

Maximum values of s for which the IDP test returns a determinate decision

Description

Search for the maximum values of parameter s for which the IDP test isurvdiff(formula,...) issues a determinate decision. The function test values of s up to the parameter smax. If for smax the IDP test is still determinate, isurvdiff.smax returns list(smax,testout). If for s=0 the test is already indeterminate, isurvdiff.smax returns list(-1,testout), where testout is the last executed test.

Usage

isurvdiff.smax(formula, ..., verbose=FALSE, accuracy=0.05, smax=12)

Arguments

formula

a formula expression of the form Surv(time, status) ~ predictor. A single predictor is admitted.

verbose

whether to display each value of s that is tried

accuracy

to which precision s should be computed

smax

to which maximum value s should be tried

...

All arguments of isurvdiff.smax are passed to isurvdiff to perform the test. Refer to the help of isurvdiff for more details about the arguments.

Value

A list with components:

s

The maximum value of s for which the test returns a determinate decision (H=0 or H=1).

test0

The value returned by isurvdiff(formula,...) for the last test performed. Refer to the help of isurvdiff for more details.

METHOD

This function implements the IDP sum-rank test describe in Mangili and others (2014).

References

Benavoli, A., Mangili, F., Zaffalon, M. and Ruggeri, F. (2014). Imprecise Dirichlet process with application to the hypothesis test on the probability that X < Y. ArXiv e-prints, http://adsabs.harvard.edu/abs/2014arXiv1402.2755B.

Mangili, F., Benavoli, A., Zaffalon, M. and de Campos, C. (2014). Imprecise Dirichlet Process for the estimate and comparison of survival functions with censored data.

See Also

Surv, isurvdiff.

Examples

data(lung,package='survival')
lung <- lung[1:40,]	# reduced data set just to ensure that the
 					# example is very fast to run for building the package
test <-isurvdiff.smax(Surv(time,status)~sex,lung,groups=c(1,2), 
	 	alternative = 'two.sided', nsamples=1000) 
                    # better to use larger value of nsamples
					# this small value is to run it quickly
print(test$test0)
cat("Maximum s giving the same decision: ",test$s)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(IDPSurvival)
Loading required package: Rsolnp
Loading required package: gtools
Loading required package: survival
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IDPSurvival/isurvdiff.smax.Rd_%03d_medium.png", width=480, height=480)
> ### Name: isurvdiff.smax
> ### Title: Maximum values of s for which the IDP test returns a determinate
> ###   decision
> ### Aliases: isurvdiff.smax
> ### Keywords: survival IDP
> 
> ### ** Examples
> 
> data(lung,package='survival')
> lung <- lung[1:40,]	# reduced data set just to ensure that the
>  					# example is very fast to run for building the package
> test <-isurvdiff.smax(Surv(time,status)~sex,lung,groups=c(1,2), 
+ 	 	alternative = 'two.sided', nsamples=1000) 
>                     # better to use larger value of nsamples
> 					# this small value is to run it quickly
> print(test$test0)


---------------------------------------------
Result of the IDP RANK-SUM hypothesis test
h = 0  --> Y and X are not different


Lower Central credible intervals
[ 0.225 , 0.569 ]
Upper Central credible intervals
[ 0.495 , 0.826 ] 
---------------------------------------------> cat("Maximum s giving the same decision: ",test$s)
Maximum s giving the same decision:  2.859375> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>