EmpiricalSurvDiff: Estimate the LR value and its associated p-values

Description Usage Arguments Details Value Author(s) Examples

View source: R/EmpiricalSurvDiff.r

Description

Permutations or Bootstrapping computation of the standardized log-rank (SLR) or the Chi=SLR^2 p-values for differences in survival times

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
	EmpiricalSurvDiff(times=times,
	                  status=status,
	                  groups=groups,
	                  samples=1000,
	                  type=c("SLR","Chi"),
	                  plots=FALSE,
	                  minAproxSamples=100,
	                  computeDist=FALSE,
	                  ...
	                  )

Arguments

times

A numeric vector with he observed times to event

status

A numeric vector indicating if the time to event is censored

groups

A numeric vector indicating the label of the two survival groups

samples

The number of bootstrap samples

type

The type of log-rank statistics. SLR or Chi

plots

If TRUE, the Kaplan-Meier plot will be plotted

minAproxSamples

The number of tail samples used for the normal-distribution approximation

computeDist

If TRUE, it will compute the bootstrapped distribution of the SLR

...

Additional parameters for the plot

Details

It will compute the null distribution of the SRL or the square SLR (Chi) via permutations, and it will return the p-value of differences between survival times between two groups. It may also be used to compute the empirical distribution of the difference in SLR using bootstrapping. (computeDist=TRUE) The p-values will be estimated based on the sampled distribution, or normal-approximated along the tails.

Value

pvalue

the minimum one-tailed p-value : min[p(SRL < 0),p(SRL > 0)] for type="SLR" or the two tailed p-value: 1-p(|SRL| > 0) for type="Chi"

LR

A list of LR statistics: LR=Expected, VR=Variance, SLR=Standardized LR.

p.equal

The two tailed p-value: 1-p(|SRL| > 0)

p.sup

The one tailed p-value: p(SRL < 0), return NA for type="Chi"

p.inf

The one tailed p-value: p(SRL > 0), return NA for type="Chi"

nullDist

permutation derived probability density function of the null distribution

LRDist

bootstrapped derived probability density function of the SLR (computeDist=TRUE)

Author(s)

Jose G. Tamez-Pena

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
29
30
	## Not run: 

      library(rpart)
      data(stagec)

      # The Log-Rank Analysis using survdiff

      lrsurvdiff <- survdiff(Surv(pgtime,pgstat)~grade>2,data=stagec)
      print(lrsurvdiff)

      # The Log-Rank Analysis: permutations of the null Chi distribution
      lrp <- EmpiricalSurvDiff(stagec$pgtime,stagec$pgstat,stagec$grade>2,
                         type="Chi",plots=TRUE,samples=10000,
                         main="Chi Null Distribution")
      print(list(unlist(c(lrp$LR,lrp$pvalue))))

      # The Log-Rank Analysis: permutations of the null SLR distribution
      lrp <- EmpiricalSurvDiff(stagec$pgtime,stagec$pgstat,stagec$grade>2,
                         type="SLR",plots=TRUE,samples=10000,
                         main="SLR Null Distribution")
      print(list(unlist(c(lrp$LR,lrp$pvalue))))

      # The Log-Rank Analysis: Bootstraping the SLR distribution
      lrp <- EmpiricalSurvDiff(stagec$pgtime,stagec$pgstat,stagec$grade>2,
                         computeDist=TRUE,plots=TRUE,samples=100000,
                         main="SLR Null and SLR bootrapped")
      print(list(unlist(c(lrp$LR,lrp$pvalue))))
	
	
## End(Not run)

FRESA.CAD documentation built on Jan. 13, 2021, 3:39 p.m.