View source: R/projection.test.R View source: R/oxy-projection.test.R
| projection.test | R Documentation |
Perform projection test as proposed by Brendel (2014)
projection.test(dat, Wlist, base, alpha = 0.05)
dat |
a dataframe or matrix, of which the first three columns are survival time, event status indicator and group label. The status indicator, normally 0=alive, 1=dead/event. Other choices are TRUE/FALSE (TRUE=death) or 1/2 (2=death). The group label can be either numeric values like 0=control, 1=treatment or text like C=control, T=treatment. |
Wlist |
a list object with components of weight functions |
base |
a text must be one of c(" |
alpha |
a number indicating type I error rate, Default: 0.05 |
The base functions are the same as those described in function
MaxLRtest. The method detail can be found in Brendel (2014)
paper. The main idea is to map the multiple weighted logrank statistics
into a chi-square distribution. The degree freedom of the chi-square
is the rank of the generalized inverse of covariance matrix. Only two-sided
test is supported in the current function.
a list of components including
chisq |
a numeric value indicating the chi-square statistic |
df.chis |
a numeric value indicating the degree freedom of the test |
pvalue |
a numeric value giving the p-value of the test |
details |
a data frame consisting of statistics from multiple weight functions and the variance-covariance matrix |
Brendel, M., Janssen, A., Mayer, C. D., & Pauly, M. (2014). Weighted logrank permutation tests for randomly right censored life science data. Scandinavian Journal of Statistics, 41(3), 742-761.
MaxLRtest
# load and prepare data
data(lung)
tmpd <- with(lung, data.frame(time=SurvTime,stat=1-censor,grp=Treatment))
# two weight functions are defined.
# one is constant weight; the other emphasize diverging hazards
timef1 <- function(x){1}
timef2 <- function(x){(x)}
test1 <- projection.test(tmpd,list(timef1,timef2),base="KM")
test1$chisq; test1$pvalue; test1$df.chisq
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.