Learn R Programming

CTP (version 3.0.1)

AnalyseCTP: Analysing a Closed Testing Procedure

Description

Calculation of p-values of a closed testing procedure (CTP). The function returns an object of oldClass "ctp"; summary() and Display() can be applied.

Usage

AnalyseCTP(ctp.struc, model, data, factor.name = NULL, test.name = "F", ...)

Arguments

ctp.struc

Object generated by the function IntersectHypotheses (structure of CTP)

model

model of the form response~treatment. If testname="F", the model can be extended by covariates and other factors. In the case of a Logrank test the response must be imputed as Surv(time,status).

data

Dataframe, missing values in the response or treatment variable are not allowed!

factor.name

Character string naming the factor whose levels are compared (treatment factor). By default the first variable of the right-hand side of the model formula is used.

test.name

One of the following strings

  • "F" - F-Test (ANOVA from linear model, default)

  • "glm" - generalised linear model

  • "kruskal" -Kruskal-Wallis-Test

  • "chisq" - Chi square test

  • "prob" - Fisher's exact test for total number of observations <200 else Chi square test

  • "lgrank" - Logrank-test

  • "jonckheere" - Jonckheere-Terpstra test of ordered alternatives

  • "glm" - generalised linear model, using function glm from stats.

...

Additional arguments for the chosen test.

Value

An object of old class(ctp), consisting of a list with:

  • CTPparms: List with objects describing the CTP setup.

  • pvalues: Dataframe with all tested hypotheses, raw and adjusted p-values.

Details

The hypothesis tree of the closed testing procedure must be created using IntersectHypotheses. For more details on the theory and the implementation as well for many examples, see the vignettes.

See Also

IntersectHypotheses, Display, summary.ctp.str, summary.ctp, Adjust_raw

Examples

Run this code
# NOT RUN {
	data(pasi)
	three.to.first <- IntersectHypotheses(list(1:2,c(1,3),c(1,4)))
	Display(three.to.first)
	pasi.ctp.F1 <- AnalyseCTP(three.to.first,pasi.ch~dose,pasi)
	summary(pasi.ctp.F1)
	Display(pasi.ctp.F1)

# }

Run the code above in your browser using DataLab