Title: | Survival Tests for One-Way Layout |
---|---|
Description: | Performs survival analysis for one-way layout. The package includes the generalized test for survival ANOVA (Tsui and Weerahandi (1989) <doi:10.2307/2289949> and (Weerahandi, 2004; ISBN:978-0471470175)). It also performs pairwise comparisons and graphical approaches. Moreover, it assesses the weibullness of data in each group via test. The package computes mean and confidence interval under Weibull distribution. |
Authors: | Osman Dag [aut, cre], Malwane Ananda [aut], Sam Weerahandi [aut] |
Maintainer: | Osman Dag <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0 |
Built: | 2025-03-04 05:02:51 UTC |
Source: | https://github.com/cran/SurvivalTests |
plot.Sdescribe
produce error bars with means and confidence limits of the given grouped values.
## S3 method for class 'Sdescribe' plot(x, ylim = NULL, xlab = NULL, ylab = NULL, title = NULL, width = NULL, ...)
## S3 method for class 'Sdescribe' plot(x, ylim = NULL, xlab = NULL, ylab = NULL, title = NULL, width = NULL, ...)
x |
a Sdescribe object. |
ylim |
a limit for y axes. |
xlab |
a label for the x axis. |
ylab |
a label for the y axis. |
title |
a main title for the plot. |
width |
the little lines at the tops and bottoms of the error bars (defaults to 0.80). |
... |
additional arguments. |
No return value, called for side effects
Osman Dag
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) out <- Sdescribe(time~age+status, lung) plot(out, ylim = c(0,500)) plot(out)
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) out <- Sdescribe(time~age+status, lung) plot(out, ylim = c(0,500)) plot(out)
SANOVA
performs generalized test for survival ANOVA.
SANOVA(formula, data, nM = 5000, seed = 123, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
SANOVA(formula, data, nM = 5000, seed = 123, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a data frame containing the variables in |
nM |
a number of bootstrap samples. |
seed |
a seed number for the reproducibility of results. Default is set to 123. |
alpha |
the level of significance to assess the statistical difference. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
SANOVA performs parametric survival ANOVA when the underlying data are distributed as Weibull or Gumbel. SANOVA tests are based on generalized p-value approach (cf. Tsui and Weerahandi (1989) and Weerahandi (2004)) extended for situations of affine invariance.
A list with class "survtests" containing the following components:
p.value |
the p-value of the test. |
alpha |
the level of significance to assess the statistical difference. |
method |
the character string "Generalized Test for Survival ANOVA". |
data |
a data frame containing the variables in which NA values (if exist) are removed. |
formula |
a formula of the form |
seed |
a seed number for the reproducibility of results. |
Sam Weerahandi, Malwane Ananda, Osman Dag
Tsui K. and Weerahandi, S. (1989). Generalized P-values in Significance Testing of Hypotheses in the Presence of Nuisance Parameters. Journal of the American Statistical Association, 84, 602-607.
Weerahandi, S. (2004). Generalized Inference in Repeated Measures: Exact Methods in MANOVA and Mixed Models, Wiley.
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) SANOVA(time~age+status, lung, alpha = 0.05)
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) SANOVA(time~age+status, lung, alpha = 0.05)
Sdescribe
produces number of observations (n), number of events (nE), and the mean survival with confidence limits for the mean.
Sdescribe(formula, data, level = 0.95, nM = 5000, na.rm = TRUE, verbose = TRUE)
Sdescribe(formula, data, level = 0.95, nM = 5000, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a data frame containing the variables in |
level |
the confidence level. |
nM |
a number of bootstrap samples. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
Returns a data.frame of output with class "Sdescribe".
Malwane Ananda, Osman Dag
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) Sdescribe(time~age+status, lung)
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) Sdescribe(time~age+status, lung)
Spaircomp
is a generic function for pairwise comparisons of survival tests in one-way layout by adjusting p-values.
## S3 method for class 'survtests' Spaircomp(x, adjust.method = c("bonferroni", "holm", "hochberg", "hommel", "BH", "BY", "fdr", "none"), verbose = TRUE, ...)
## S3 method for class 'survtests' Spaircomp(x, adjust.method = c("bonferroni", "holm", "hochberg", "hommel", "BH", "BY", "fdr", "none"), verbose = TRUE, ...)
x |
a |
adjust.method |
Method for adjusting p values (see |
verbose |
a logical for printing output to R console. |
... |
Additional arguments affecting multiple comparisons of groups in one-way independent designs. |
Returns a data.frame of output.
Osman Dag
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) out = SANOVA(time~age+status, lung, alpha = 0.05) Spaircomp(out, adjust.method = "bonferroni") # to illustrate pairwise comparison, alpha is set to 0.5 out2 = SANOVA(time~age+status, lung, alpha = 0.5) Spaircomp(out2, adjust.method = "bonferroni") Spaircomp(out2, adjust.method = "hochberg") Spaircomp(out2, adjust.method = "hommel") Spaircomp(out2, adjust.method = "holm")
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) out = SANOVA(time~age+status, lung, alpha = 0.05) Spaircomp(out, adjust.method = "bonferroni") # to illustrate pairwise comparison, alpha is set to 0.5 out2 = SANOVA(time~age+status, lung, alpha = 0.5) Spaircomp(out2, adjust.method = "bonferroni") Spaircomp(out2, adjust.method = "hochberg") Spaircomp(out2, adjust.method = "hommel") Spaircomp(out2, adjust.method = "holm")
weibull.test
performs weibullness test from weibull plot in each group.
weibull.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
weibull.test(formula, data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
formula |
a formula of the form |
data |
a tibble or data frame containing the variables in |
alpha |
the level of significance to assess normality. Default is set to alpha = 0.05. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
verbose |
a logical for printing output to R console. |
A data frame gives the test results for the weibullness of groups.
Osman Dag
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) weibull.test(time~age, lung)
library(survival) lung$status <- ifelse(lung$status == 2, 1, 0) lung$age <- arules::discretize(lung$age, breaks = 3, labels = c("Low","Medium","High")) library(SurvivalTests) weibull.test(time~age, lung)