Docsity

Comandos R studios - Kruskall, Esquemas de Econometria

Toggle sidebar
bg1
Package ‘coin’
August 28, 2019
Version 1.3-1
Date 2019-08-22
Title Conditional Inference Procedures in a Permutation Test Framework
Description Conditional inference procedures for the general independence
problem including two-sample, K-sample (non-parametric ANOVA), correlation,
censored, ordered and multivariate problems.
Depends R (>= 3.4.0), survival
Imports methods, parallel, stats, stats4, utils, libcoin (>= 1.0-0),
matrixStats (>= 0.54.0), modeltools (>= 0.2-9), mvtnorm (>=
1.0-5), multcomp
Suggests xtable, e1071, vcd, TH.data (>= 1.0-7)
LinkingTo libcoin (>= 1.0-0)
LazyData yes
NeedsCompilation yes
ByteCompile yes
License GPL-2
URL http://coin.r-forge.r-project.org
Author Torsten Hothorn [aut, cre] (<https://orcid.org/0000-0001-8301-0471>),
Henric Winell [aut] (<https://orcid.org/0000-0001-7995-3047>),
Kurt Hornik [aut] (<https://orcid.org/0000-0003-4198-9911>),
Mark A. van de Wiel [aut] (<https://orcid.org/0000-0003-4780-8472>),
Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>)
Maintainer Torsten Hothorn <[email protected]>
Repository CRAN
Date/Publication 2019-08-28 11:50:06 UTC
Rtopics documented:
coin-package ........................................ 3
alpha............................................. 4
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63

Pré-visualização parcial do texto

Baixe Comandos R studios - Kruskall e outras Esquemas em PDF para Econometria, somente na Docsity!

Package ‘coin’

August 28, 2019

Version 1.3-

Date 2019-08-

Title Conditional Inference Procedures in a Permutation Test Framework

Description Conditional inference procedures for the general independence problem including two-sample, K-sample (non-parametric ANOVA), correlation, censored, ordered and multivariate problems.

Depends R (>= 3.4.0), survival

Imports methods, parallel, stats, stats4, utils, libcoin (>= 1.0-0), matrixStats (>= 0.54.0), modeltools (>= 0.2-9), mvtnorm (>= 1.0-5), multcomp

Suggests xtable, e1071, vcd, TH.data (>= 1.0-7)

LinkingTo libcoin (>= 1.0-0)

LazyData yes

NeedsCompilation yes

ByteCompile yes

License GPL-

URL http://coin.r-forge.r-project.org

Author Torsten Hothorn [aut, cre] (), Henric Winell [aut] (), Kurt Hornik [aut] (), Mark A. van de Wiel [aut] (), Achim Zeileis [aut] ()

Maintainer Torsten Hothorn

Repository CRAN

Date/Publication 2019-08-28 11:50:06 UTC

R topics documented:

coin-package........................................ 3 alpha............................................. 4

2 R topics documented:

  • alzheimer
  • asat
  • ContingencyTests
  • CorrelationTests
  • CWD
  • expectation-methods
  • glioma
  • GTSG
  • hohnloser
  • IndependenceLinearStatistic-class
  • IndependenceProblem-class
  • IndependenceTest
  • IndependenceTest-class
  • IndependenceTestProblem-class
  • IndependenceTestStatistic-class
  • jobsatisfaction
  • LocationTests
  • malformations
  • MarginalHomogeneityTests
  • MaximallySelectedStatisticsTests
  • mercuryfish
  • neuropathy
  • NullDistribution
  • NullDistribution-class
  • NullDistribution-methods
  • ocarcinoma
  • PermutationDistribution-methods
  • photocar
  • PValue-class
  • pvalue-methods
  • rotarod
  • ScaleTests
  • statistic-methods
  • SurvivalTests
  • SymmetryProblem-class
  • SymmetryTest
  • SymmetryTests
  • Transformations
  • treepipit
  • VarCovar-class
  • vision
  • Index

4 alpha

Examples

Not run:

Generate doxygen documentation if you are interested in the internals:

Download source package into a temporary directory

tmpdir <- tempdir() tgz <- download.packages("coin", destdir = tmpdir, type = "source")[2]

Extract contents

untar(tgz, exdir = tmpdir)

Run doxygen (assuming it is installed)

wd <- setwd(file.path(tmpdir, "coin")) system("doxygen inst/doxygen.cfg") setwd(wd)

Have fun!

browseURL(file.path(tmpdir, "coin", "inst", "documentation", "html", "index.html"))

End(Not run)

alpha Genetic Components of Alcoholism

Description

Levels of expressed alpha synuclein mRNA in three groups of allele lengths of NACP-REP1.

Usage

alpha

Format

A data frame with 97 observations on 2 variables.

alength allele length, a factor with levels "short", "intermediate" and "long". elevel expression levels of alpha synuclein mRNA.

Details

Various studies have linked alcohol dependence phenotypes to chromosome 4. One candidate gene is NACP (non-amyloid component of plaques), coding for alpha synuclein. Bönsch et al. (2005) found longer alleles of NACP-REP1 in alcohol-dependent patients compared with healthy controls and reported that the allele lengths show some association with levels of expressed alpha synuclein mRNA.

Source

Bönsch, D., Lederer, T., Reulbach, U., Hothorn, T., Kornhuber, J. and Bleich, S. (2005). Joint analysis of the NACP-REP1 marker within the alpha synuclein gene concludes association with alcohol dependence. Human Molecular Genetics 14 (7), 967–971. doi: 10.1093/hmg/ddi

alzheimer 5

References

Hothorn, T., Hornik, K., van de Wiel, M. A. and Zeileis, A. (2006). A Lego system for conditional inference. The American Statistician 60 (3), 257–263. doi: 10.1198/000313006X Winell, H. and Lindbäck, J. (2018). A general score-independent test for order-restricted inference. Statistics in Medicine 37 (21), 3078–3090. doi: 10.1002/sim.

Examples

Boxplots

boxplot(elevel ~ alength, data = alpha)

Asymptotic Kruskal-Wallis test

kruskal_test(elevel ~ alength, data = alpha)

Asymptotic Kruskal-Wallis test using midpoint scores

kruskal_test(elevel ~ alength, data = alpha, scores = list(alength = c(2, 7, 11)))

Asymptotic score-independent test

Winell and Lindbaeck (2018)

(it <- independence_test(elevel ~ alength, data = alpha, ytrafo = function(data) trafo(data, numeric_trafo = rank_trafo), xtrafo = function(data) trafo(data, factor_trafo = function(x) zheng_trafo(as.ordered(x)))))

Extract the "best" set of scores

ss <- statistic(it, type = "standardized") idx <- which(abs(ss) == max(abs(ss)), arr.ind = TRUE) ss[idx[1], idx[2], drop = FALSE]

alzheimer Smoking and Alzheimer’s Disease

Description

A case-control study of smoking and Alzheimer’s disease.

Usage

alzheimer

Format

A data frame with 538 observations on 3 variables.

smoking a factor with levels "None", "<10", "10-20" and ">20" (cigarettes per day). disease a factor with levels "Alzheimer", "Other dementias" and "Other diagnoses". gender a factor with levels "Female" and "Male".

ContingencyTests 7

Details

The aim of this toxicological study is the proof of safety for the new compound. The data were originally given in Hothorn (1992) and later reproduced by Hauschke, Kieser and Hothorn (1999).

Source

Hauschke, D., Kieser, M. and Hothorn, L. A. (1999). Proof of safety in toxicology based on the ratio of two means for normally distributed data. Biometrical Journal 41 (3), 295–304. doi: 10.1002/ (SICI)15214036(199906)41:3<295::AIDBIMJ295>3.0.CO; Hothorn, L. A. (1992). Biometrische analyse toxikologischer untersuchungen. In J. Adam (Ed.), Statistisches Know-How in der Medizinischen Forschung, pp. 475–590. Berlin: Ullstein Mosby.

References

Pflüger, R. and Hothorn, T. (2002). Assessing equivalence tests with respect to their expected p- value. Biometrical Journal 44 (8), 1015–1027. doi: 10.1002/bimj.

Examples

Proof-of-safety based on ratio of medians (Pflueger and Hothorn, 2002)

One-sided exact Wilcoxon-Mann-Whitney test

wt <- wilcox_test(I(log(asat)) ~ group, data = asat, distribution = "exact", alternative = "less", conf.int = TRUE)

One-sided confidence set

Note: Safety cannot be concluded since the effect of the compound

exceeds 20 % of the control median

exp(confint(wt)$conf.int)

ContingencyTests Tests of Independence in Two- or Three-Way Contingency Tables

Description

Testing the independence of two nominal or ordered factors.

Usage

S3 method for class 'formula'

chisq_test(formula, data, subset = NULL, weights = NULL, ...)

S3 method for class 'table'

chisq_test(object, ...)

S3 method for class 'IndependenceProblem'

chisq_test(object, ...)

S3 method for class 'formula'

8 ContingencyTests

cmh_test(formula, data, subset = NULL, weights = NULL, ...)

S3 method for class 'table'

cmh_test(object, ...)

S3 method for class 'IndependenceProblem'

cmh_test(object, ...)

S3 method for class 'formula'

lbl_test(formula, data, subset = NULL, weights = NULL, ...)

S3 method for class 'table'

lbl_test(object, ...)

S3 method for class 'IndependenceProblem'

lbl_test(object, ...)

Arguments

formula a formula of the form y ~ x | block where y and x are factors and block is an optional factor for stratification. data an optional data frame containing the variables in the model formula. subset an optional vector specifying a subset of observations to be used. Defaults to NULL. weights an optional formula of the form ~ w defining integer valued case weights for each observation. Defaults to NULL, implying equal weight for all observations. object an object inheriting from classes "table" or "IndependenceProblem". ... further arguments to be passed to independence_test.

Details

chisq_test, cmh_test and lbl_test provide the Pearson chi-squared test, the generalized Cochran- Mantel-Haenszel test and the linear-by-linear association test. A general description of these meth- ods is given by Agresti (2002). The null hypothesis of independence, or conditional independence given block, between y and x is tested. If y and/or x are ordered factors, the default scores, 1:nlevels(y) and 1:nlevels(x) respectively, can be altered using the scores argument (see independence_test); this argument can also be used to coerce nominal factors to class "ordered". (lbl_test coerces to class "ordered" un- der any circumstances.) If both y and x are ordered factors, a linear-by-linear association test is computed and the direction of the alternative hypothesis can be specified using the alternative argument. For the Pearson chi-squared test, this extension was given by Yates (1948) who also dis- cussed the situation when either the response or the covariate is an ordered factor; see also Cochran (1954) and Armitage (1955) for the particular case when y is a binary factor and x is ordered. The Mantel-Haenszel statistic (Mantel and Haenszel, 1959) was similarly extended by Mantel (1963) and Landis, Heyman and Koch (1978). The conditional null distribution of the test statistic is used to obtain p-values and an asymptotic approximation of the exact distribution is used by default (distribution = "asymptotic"). Alter- natively, the distribution can be approximated via Monte Carlo resampling or computed exactly for univariate two-sample problems by setting distribution to "approximate" or "exact" respec- tively. See asymptotic, approximate and exact for details.

10 ContingencyTests

midpvalue(ct) # mid-p-value pvalue_interval(ct) # p-value interval size(ct, alpha = 0.05) # test size at alpha = 0.05 using the p-value

Exact Pearson chi-squared test (Davis, 1986)

Note: disagrees with Fisher's exact test

ct <- chisq_test(davis, distribution = "exact") pvalue(ct) # standard p-value midpvalue(ct) # mid-p-value pvalue_interval(ct) # p-value interval size(ct, alpha = 0.05) # test size at alpha = 0.05 using the p-value fisher.test(davis)

Laryngeal cancer data

Agresti (2002, p. 107, Tab. 3.13)

cancer <- matrix( c(21, 2, 15, 3), nrow = 2, byrow = TRUE, dimnames = list( "Treatment" = c("Surgery", "Radiation"), "Cancer" = c("Controlled", "Not Controlled") ) ) cancer <- as.table(cancer)

Exact Pearson chi-squared test (Agresti, 2002, p. 108, Tab. 3.14)

Note: agrees with Fishers's exact test

(ct <- chisq_test(cancer, distribution = "exact")) midpvalue(ct) # mid-p-value pvalue_interval(ct) # p-value interval size(ct, alpha = 0.05) # test size at alpha = 0.05 using the p-value fisher.test(cancer)

Homework conditions and teacher's rating

Yates (1948, Tab. 1)

yates <- matrix( c(141, 67, 114, 79, 39, 131, 66, 143, 72, 35, 36, 14, 38, 28, 16), byrow = TRUE, ncol = 5, dimnames = list( "Rating" = c("A", "B", "C"), "Condition" = c("A", "B", "C", "D", "E") ) ) yates <- as.table(yates)

Asymptotic Pearson chi-squared test (Yates, 1948, p. 176)

ContingencyTests 11

chisq_test(yates)

Asymptotic Pearson-Yates chi-squared test (Yates, 1948, pp. 180-181)

Note: 'Rating' and 'Condition' as ordinal

(ct <- chisq_test(yates, alternative = "less", scores = list("Rating" = c(-1, 0, 1), "Condition" = c(2, 1, 0, -1, -2)))) statistic(ct)^2 # chi^2 = 2.

Asymptotic Pearson-Yates chi-squared test (Yates, 1948, p. 181)

Note: 'Rating' as ordinal

chisq_test(yates, scores = list("Rating" = c(-1, 0, 1))) # Q = 3.

Change in clinical condition and degree of infiltration

Cochran (1954, Tab. 6)

cochran <- matrix( c(11, 7, 27, 15, 42, 16, 53, 13, 11, 1), byrow = TRUE, ncol = 2, dimnames = list( "Change" = c("Marked", "Moderate", "Slight", "Stationary", "Worse"), "Infiltration" = c("0-7", "8-15") ) ) cochran <- as.table(cochran)

Asymptotic Pearson chi-squared test (Cochran, 1954, p. 435)

chisq_test(cochran) # X^2 = 6.

Asymptotic Cochran-Armitage test (Cochran, 1954, p. 436)

Note: 'Change' as ordinal

(ct <- chisq_test(cochran, scores = list("Change" = c(3, 2, 1, 0, -1)))) statistic(ct)^2 # X^2 = 6.

Change in size of ulcer crater for two treatment groups

Armitage (1955, Tab. 2)

armitage <- matrix( c( 6, 4, 10, 12, 11, 8, 8, 5), byrow = TRUE, ncol = 4, dimnames = list( "Treatment" = c("A", "B"), "Crater" = c("Larger", "< 2/3 healed", ">= 2/3 healed", "Healed")

CorrelationTests 13

fisyat_test(object, distribution = c("asymptotic", "approximate", "none"), ties.method = c("mid-ranks", "average-scores"), ...)

S3 method for class 'formula'

quadrant_test(formula, data, subset = NULL, weights = NULL, ...)

S3 method for class 'IndependenceProblem'

quadrant_test(object, distribution = c("asymptotic", "approximate", "none"), mid.score = c("0", "0.5", "1"), ...)

S3 method for class 'formula'

koziol_test(formula, data, subset = NULL, weights = NULL, ...)

S3 method for class 'IndependenceProblem'

koziol_test(object, distribution = c("asymptotic", "approximate", "none"), ties.method = c("mid-ranks", "average-scores"), ...)

Arguments

formula a formula of the form y ~ x | block where y and x are numeric variables and block is an optional factor for stratification. data an optional data frame containing the variables in the model formula. subset an optional vector specifying a subset of observations to be used. Defaults to NULL. weights an optional formula of the form ~ w defining integer valued case weights for each observation. Defaults to NULL, implying equal weight for all observations. object an object inheriting from class "IndependenceProblem". distribution a character, the conditional null distribution of the test statistic can be approx- imated by its asymptotic distribution ("asymptotic", default) or via Monte Carlo resampling ("approximate"). Alternatively, the functions asymptotic or approximate can be used. Computation of the null distribution can be sup- pressed by specifying "none". ties.method a character, the method used to handle ties: the score generating function ei- ther uses mid-ranks ("mid-ranks", default) or averages the scores of randomly broken ties ("average-scores"). mid.score a character, the score assigned to observations exactly equal to the median: ei- ther 0 ("0", default), 0.5 ("0.5") or 1 ("1"); see median_test. ... further arguments to be passed to independence_test.

Details

spearman_test, fisyat_test, quadrant_test and koziol_test provide the Spearman correla- tion test, the Fisher-Yates correlation test using van der Waerden scores, the quadrant test and the Koziol-Nemec test. A general description of these methods is given by Hájek, Šidák and Sen (1999, Sec. 4.6). The Koziol-Nemec test was suggested by Koziol and Nemec (1979). For the adjustment of scores for tied values see Hájek, Šidák and Sen (1999, pp. 133–135). The null hypothesis of independence, or conditional independence given block, between y and x is tested.

14 CWD

The conditional null distribution of the test statistic is used to obtain p-values and an asymptotic approximation of the exact distribution is used by default (distribution = "asymptotic"). Alter- natively, the distribution can be approximated via Monte Carlo resampling by setting distribution to "approximate". See asymptotic and approximate for details.

Value

An object inheriting from class "IndependenceTest".

References

Hájek, J., Šidák, Z. and Sen, P. K. (1999). Theory of Rank Tests, Second Edition. San Diego: Academic Press. Koziol, J. A. and Nemec, A. F. (1979). On a Cramér-von Mises type statistic for testing bivariate independence. The Canadian Journal of Statistics 7 (1), 43–52. doi: 10.2307/

Examples

Asymptotic Spearman test

spearman_test(CONT ~ INTG, data = USJudgeRatings)

Asymptotic Fisher-Yates test

fisyat_test(CONT ~ INTG, data = USJudgeRatings)

Asymptotic quadrant test

quadrant_test(CONT ~ INTG, data = USJudgeRatings)

Asymptotic Koziol-Nemec test

koziol_test(CONT ~ INTG, data = USJudgeRatings)

CWD Coarse Woody Debris

Description

Carbon flux on six pieces of wood.

Usage

CWD

Format

A data frame with 13 observations on 8 variables.

sample2 carbon flux measurement for 2nd piece of wood. sample3 carbon flux measurement for 3rd piece of wood. sample4 carbon flux measurement for 4th piece of wood.

16 expectation-methods

mt <- maxstat_test(sample2 + sample3 + sample4 + sample6 + sample7 + sample8 ~ trend, data = CWD, distribution = approximate(nresample = 100000))

Absolute maximum of standardized statistics (t = 3.08)

statistic(mt)

5% critical value (t_0.05 = 2.86)

(c <- qperm(mt, 0.95))

Only 'sample8' exceeds the 5% critical value

sts <- statistic(mt, type = "standardized") idx <- which(sts > c, arr.ind = TRUE) sts[unique(idx[, 1]), unique(idx[, 2]), drop = FALSE]

expectation-methods Extraction of the Expectation, Variance and Covariance of the Linear Statistic

Description

Methods for extraction of the expectation, variance and covariance of the linear statistic.

Usage

S4 method for signature 'IndependenceLinearStatistic'

expectation(object, ...)

S4 method for signature 'IndependenceTest'

expectation(object, ...)

S4 method for signature 'Variance'

variance(object, ...)

S4 method for signature 'CovarianceMatrix'

variance(object, ...)

S4 method for signature 'IndependenceLinearStatistic'

variance(object, ...)

S4 method for signature 'IndependenceTest'

variance(object, ...)

S4 method for signature 'CovarianceMatrix'

covariance(object, ...)

S4 method for signature 'IndependenceLinearStatistic'

covariance(object, ...)

S4 method for signature 'IndependenceTest'

covariance(object, ...)

glioma 17

Arguments

object an object from which the expectation, variance or covariance of the linear statis- tic can be extracted. ... further arguments (currently ignored).

Details

The methods expectation, variance and covariance extract the expectation, variance and co- variance, respectively, of the linear statistic.

Value

The expectation, variance or covariance of the linear statistic extracted from object. A numeric vector or matrix.

Examples

Example data

dta <- data.frame( y = gl(3, 2), x = sample(gl(3, 2)) )

Asymptotic Cochran-Mantel-Haenszel Test

ct <- cmh_test(y ~ x, data = dta)

The linear statistic, i.e., the contingency table...

(l <- statistic(ct, type = "linear"))

...and its expectation...

(El <- expectation(ct))

...and covariance

(Vl <- covariance(ct))

The standardized contingency table...

(l - El) / sqrt(variance(ct))

...is identical to the standardized linear statistic

statistic(ct, type = "standardized")

glioma Malignant Glioma Pilot Study

Description

A non-randomized pilot study on malignant glioma patients with pretargeted adjuvant radioim- munotherapy using yttrium-90-biotin.

GTSG 19

gbm <- subset(glioma, histology == "GBM")

Plot Kaplan-Meier estimates

plot(survfit(Surv(time, event) ~ group, data = gbm), main = "Grade IV Glioma", lty = 2:1, ylab = "Probability", xlab = "Survival Time in Month", xlim = c(-2, 72)) legend("topright", lty = 2:1, c("Control", "Treated"), bty = "n") par(op) # reset

Exact logrank test

logrank_test(Surv(time, event) ~ group, data = gbm, distribution = "exact")

Stratified approximative (Monte Carlo) logrank test

logrank_test(Surv(time, event) ~ group | histology, data = glioma, distribution = approximate(nresample = 10000))

GTSG Gastrointestinal Tumor Study Group

Description

A randomized clinical trial in gastric cancer.

Usage

GTSG

Format

A data frame with 90 observations on 3 variables.

time survival time (days). event status indicator for time: 0 for right-censored observations and 1 otherwise. group a factor with levels "Chemotherapy+Radiation" and "Chemotherapy".

Details

A clinical trial comparing chemotherapy alone versus a combination of chemotherapy and radiation therapy in the treatment of locally advanced, nonresectable gastric carcinoma.

Note

There is substantial separation between the estimated survival distributions at 8 to 10 months, but by month 26 the distributions intersect.

20 GTSG

Source

Stablein, D. M., Carter, W. H., Jr. and Novak, J. W. (1981). Analysis of survival data with nonproportional hazard functions. Controlled Clinical Trials 2 (2), 149–159. doi: 10.1016/0197- 2456(81)

References

Moreau, T., Maccario, J., Lellouch, J. and Huber, C. (1992). Weighted log rank statistics for com- paring two distributions. Biometrika 79 (1), 195–198. doi: 10.1093/biomet/79.1.

Shen, W. and Le, C. T. (2000). Linear rank tests for censored survival data. Communications in Statistics – Simulation and Computation 29 (1), 21–36. doi: 10.1080/

Tubert-Bitter, P., Kramar, A., Chalé, J. J. and Moureau, T. (1994). Linear rank tests for comparing survival in two groups with crossing hazards. Computational Statistics & Data Analysis 18 (5), 547–559. doi: 10.1016/01679473(94)

Examples

Plot Kaplan-Meier estimates

plot(survfit(Surv(time / (365.25 / 12), event) ~ group, data = GTSG), lty = 1:2, ylab = "% Survival", xlab = "Survival Time in Months") legend("topright", lty = 1:2, c("Chemotherapy+Radiation", "Chemotherapy"), bty = "n")

Asymptotic logrank test

logrank_test(Surv(time, event) ~ group, data = GTSG)

Asymptotic Prentice test

logrank_test(Surv(time, event) ~ group, data = GTSG, type = "Prentice")

Asymptotic test against Weibull-type alternatives (Moreau et al., 1992)

moreau_weight <- function(time, n.risk, n.event) 1 + log(-log(cumprod(n.risk / (n.risk + n.event))))

independence_test(Surv(time, event) ~ group, data = GTSG, ytrafo = function(data) trafo(data, surv_trafo = function(y) logrank_trafo(y, weight = moreau_weight)))

Asymptotic test against crossing-curve alternatives (Shen and Le, 2000)

shen_trafo <- function(x) ansari_trafo(logrank_trafo(x, type = "Prentice"))

independence_test(Surv(time, event) ~ group, data = GTSG, ytrafo = function(data) trafo(data, surv_trafo = shen_trafo))