## S3 method for class 'data.frame':
maxstat.test(formula, data, subset, na.action, \dots)
maxstat(y, x=NULL, smethod=c("Wilcoxon", "Median",
"NormalQuantil","LogRank", "Data"), pmethod=c("none", "Lau92",
"Lau94", "exactGauss", "HL", "condMC", "min"), iscores=(pmethod=="HL"),
minprop = 0.1, maxprop=0.9, alpha = NULL, keepxy=TRUE, ...)1:length(x)? This is TRUE by default for pmethod=="HL" and
FALSE otherwise.minprop*100% of the observations in the
first group.minprop*100% of the observations in
the first group.alpha is specified. Used for plotting within plot.maxtest.y and x as elements of the
maxtest object.lhs ~ rhs where lhs is the response variable.
For survival problems, i.e. using the log-rank statistic, the
formula is of the form Surv(time, event) ~ rhsdata is required.NAs. Defaults to
getOption("na.action").pmvnorm or B, an integer
defining the number of Monte-Carlo replications.maxtest or mmaxtest (if more than one
covariable was specified) containing the following components
is returned:x) which separates
y best.maxtest objects, one for each
covariable.maxstats with
smallest p-value.plot.maxtest and print.maxtest can be used for
plotting and printing. If keepxy = TRUE, there are elements y
and x giving the response and independent variable.x for a
dependent variable y can be determined by a maximally selected rank
statistic. smethod determines the kind of statistic to be used.
Wilcoxon and Median denote maximally selected
Wilcoxon and Median statistics. NormalQuantile and
LogRank denote v.d. Waerden and log-rank
scores.
pmethod specifies which kind of approximation of the p-value should
be used. Lau92 is the limiting distribution by a Brownian bridge
(see Lausen and Schumacher, 1992, and pLausen92),
Lau94 the approximation based on an improved Bonferroni
inequality (see Lausen, Sauerbrei and Schumacher, 1994, and pLausen94).
exactGauss returns the exact p-value for a maximally selected Gauss
statistic, see Hothorn and Lausen (2003).
HL is a small sample approximation based on the Streitberg-R"ohmel
algorithm (see pperm) introduced by Hothorn and
Lausen (2003). This requires integer
valued scores. For v. d. Waerden and Log-rank scores we try to find
integer valued scores having the same shape. This results in slightly
different scores (and a different test), the procedure is described in
Hothorn (2001) and Hothorn and Lausen (2003).
All the approximations are known to be conservative, so min gives
the minimum p-value of all procedures.
condMC simulates the distribution via conditional Monte-Carlo.
For survival problems, i.e. using a maximally selected log-rank statistic,
the interface is similar to survfit. The depended
variable is a survival object Surv(time, event). The argument
event may be a numeric vector of 0 (alive) and 1
(dead) or a vector of logicals with TRUE indicating death.
If more than one covariable is specified in the right hand side of
formula (or if x is a matrix or data frame), the variable with
smallest p-value is selected and the p-value for the global test problem of
independence of y and every variable on the right hand side is
returned (see Lausen et al., 2002).
Lausen, B. and Schumacher, M. (1992). Maximally Selected Rank Statistics. Biometrics, 48, 73--85
Lausen, B., Sauerbrei, W. and Schumacher, M. (1994). Classification and Regression Trees (CART) used for the exploration of prognostic factors measured on different scales. in: P. Dirschedl and R. Ostermann (Eds), Computational Statistics, Heidelberg, Physica-Verlag, 483--496
Hothorn, T. (2001). On Exact Rank Tests in R. R News, 1, 11--12
Lausen, B., Hothorn, T., Bretz, F. and Schmacher, M. (2002).
Assessment of Optimally Selected Prognostic Factors.
submitted. Preprint available from
x <- sort(runif(20))
y <- c(rnorm(10), rnorm(10, 2))
mydata <- data.frame(cbind(x,y))
mod <- maxstat.test(y ~ x, data=mydata, smethod="Wilcoxon", pmethod="HL",
minprop=0.25, maxprop=0.75, alpha=0.05)
print(mod)
plot(mod)
# adjusted for more than one prognostic factor.
data(DLBCL)
mstat <- maxstat.test(Surv(time, cens) ~ IPI + MGE, data=DLBCL,
smethod="LogRank", pmethod="exactGauss",
abseps=0.01)
plot(mstat)Run the code above in your browser using DataLab