Learn R Programming

rankFD (version 0.0.5)

rank.two.samples: A function for analyzing two-sample problems

Description

The rank.two.samples() function calculates the weighted or unweighted treatment effect in a two-sample problem. In addition to rankFD, the user can specify the alternative and choose from a variety of different possibilities to calculate confidence intervals, see the details below. Furthermore, a Wilcoxon test is calculate with the possibility to consider shift effects.

Usage

rank.two.samples(formula, data, conf.level = 0.95,
  alternative = c("two.sided", "less", "greater"), rounds = 3,
  method = c("logit", "probit", "normal", "t.app", "permu"),
  plot.simci = FALSE, info = TRUE, wilcoxon = c("asymptotic",
  "exact"), shift.int = TRUE, nperm = 10000)

Arguments

formula

A model formula object. The left hand side contains the response variable and the right hand side contains the factor variables of interest. An interaction term must be specified.

data

A data.frame, list or environment containing the variables in formula. The default option is NULL.

conf.level

A number specifying the confidence level; the default is 0.95.

alternative

Which alternative is considered? One of "two.sided", "less", "greater".

rounds

Value specifying the number of digits the results are rounded to.

method

specifying the method used for calculation of the confidence intervals. One of "logit", "probit", "normal", "t.app" and "permu".

plot.simci

Logical, indicating whether or not confidence intervals should be plotted

info

Logical. info = FALSE suppresses the output of additional information concerning e.g. the interpretation of the test results.

wilcoxon

asymptotic or exact calculation of Wilcoxon test.

shift.int

Logical, indicating whether or not shift effects should be considered.

nperm

Number of permutations used, default is 10000.

Details

The confidence intervals are given for the treatment effect \(p = P(X_1 < Y_1) + \frac{1}{2}P(X_1 = Y_1)\) underlying the Wilcoxon-Mann-Whitney test including tied data. Different methods for calculation can be chosen, see Pauly et al.(2016) for the permutation approach, Brunner and Munzel (2000) for the t-approximation and Kaufmann et al.(2005) for the transformations. For plotting, the parameter plot.simci must be set to TRUE.

References

Brunner, E. and Munzel, U. (2000). The nonparametric Behrens-Fisher problem: Asymptotic theory and a small-sample approximation. Biometrical Journal 1, 17 - 21.

Kaufmann, J., Werner, C., and Brunner, E. (2005). Nonparametric methods for analysing the accuracy of diagnostic tests with multiple readers. Statistical Methods in Medical Research 14, 129 - 146

Pauly, M., Asendorf, T., and Konietschke, F. (2016). Permutation tests and confidence intervals for the area under the ROC-curve. Biometrical Journal, to appear.

See Also

rankFD

Examples

Run this code
# NOT RUN {
data(Muco)
Muco2 <- subset(Muco, Disease != "OAD")
twosample <- rank.two.samples(HalfTime ~ Disease, data = Muco2, 
   alternative = "greater", method = "probit", wilcoxon = "exact", plot.simci = FALSE, 
   shift.int = FALSE)

# }

Run the code above in your browser using DataLab