Last data update: 2014.03.03

R: Simultaneous Tests for Ratios of Means of Multiple Endpoints
SimTestRatR Documentation

Simultaneous Tests for Ratios of Means of Multiple Endpoints

Description

Simultaneous tests for ratios of contrasts (linear functions) of normal means (e.g., "Dunnett", "Tukey", "Williams" ect.) when there is more than one primary response variable (endpoint). The procedure of Hasler and Hothorn (2012) is applied for ratios of means of normally distributed data. The covariance matrices (containing the covariances between the endpoints) may be assumed to be equal or possibly unequal for the different groups (Hasler, 2014). For the case of only a single endpoint and unequal covariance matrices (variances), the procedure coincides with the PI procedure of Hasler and Hothorn (2008).

Usage

SimTestRat(data, grp, resp = NULL, type = "Dunnett", base = 1, Num.Contrast = NULL,
           Den.Contrast = NULL, alternative = "two.sided", Margin = NULL,
           covar.equal = FALSE)

Arguments

data

a data frame containing a grouping variable and the endpoints as columns

grp

a character string with the name of the grouping variable

resp

a vector of character strings with the names of the endpoints; if resp=NULL (default), all column names of the data frame without the grouping variable are chosen automatically

type

a character string, defining the type of contrast, with the following options:

  • "Dunnett": many-to-one comparisons, with control in the denominator

  • "Tukey": all-pair comparisons

  • "Sequen": comparisons of consecutive groups, where the group with lower order is the denomniator

  • "AVE": comparison of each group with average of all others, where the average is taken as denominator

  • "GrandMean": comparison of each group with grand mean of all groups, where the grand mean is taken as denominator

  • "Changepoint": ratios of averages of groups of higher order divided by averages of groups of lower order

  • "Marcus": Marcus contrasts as ratios

  • "McDermott": McDermott contrasts as ratios

  • "Williams": Williams contrasts as ratios

  • "UmbrellaWilliams": Umbrella-protected Williams contrasts as ratios

note that type is ignored if Num.Contrast and Den.Contrast are specified by the user (see below)

base

a single integer specifying the control (i.e. denominator) group for Dunnett contrasts, ignored otherwise

Num.Contrast

a numerator contrast matrix, where columns correspond to groups and rows correspond to contrasts

Den.Contrast

a denominator contrast matrix, where columns correspond to groups and rows correspond to contrasts

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less"

Margin

a single numeric value, or a numeric vector corresponding to endpoints, or a matrix where columns correspond to endpoints and rows correspond to contrasts, default is 1

covar.equal

a logical variable indicating whether to treat the covariance matrices (containing the covariances between the endpoints) for the different groups as being equal; if TRUE then the pooled covariance matrix is used, otherwise the Satterthwaite approximation to the degrees of freedom is used according to Hasler and Hothorn (2008)

Details

The interest is in simultaneous tests for several ratios of linear combinations (contrasts) of treatment means in a one-way ANOVA model, and simultaneously for multiple endpoints. For example, the all-pair comparison of Tukey (1953) and the many-to-one comparison of Dunnett (1955) for ratios of means are implemented, but allowing for multiple endpoints. Also, the user is free to create other interesting problem-specific contrasts. An approximate multivariate t-distribution is used to calculate (adjusted) p-values (see Hasler and Hothorn, 2012). This approach controls the familywise error rate in an admissible range and in the strong sense. The covariance matrices of the treatment groups (containing the covariances between the endpoints) can be assumed to be equal (covar.equal=TRUE) or unequal (covar.equal=FALSE). If being equal, the pooled covariance matrix is used, otherwise approximations to the degrees of freedom (Satterthwaite, 1946) are used (see Hasler, 2014). Unequal covariance matrices occure if variances or correlations of some endpoints differ depending on the treatment groups.

Value

An object of class SimTest containing:

estimate

a matrix of estimated ratios

statistic

a matrix of the calculated test statistics

p.val.raw

a matrix of raw p-values

p.val.adj

a matrix of p-values adjusted for multiplicity

CorrMatDat

either the estimated common correlation matrix of the data (covar.equal=TRUE) or the list of the different (one for each treatment) estimated correlation matrices of the data (covar.equal=FALSE)

CorrMatComp

the estimated correlation matrix to be used for the multivariate t-distribution

degr.fr

either a single degree of freedom (covar.equal=TRUE) or a vector of degrees of freedom (covar.equal=FALSE) related to the comparisons

Note

All measurement objects of each treatment group must have values for each endpoint. If there are missing values then the procedure stops. If covar.equal=TRUE, then the number of endpoints must not be greater than the total sample size minus the number of treatment groups. If covar.equal=FALSE, the number of endpoints must not be greater than the minimal sample size minus 1. Otherwise the procedure stops.

All hypotheses are tested with the same test direction for all comparisons and endpoints (alternative="..."). In case of doubt, use "two.sided".

If Margin is a single numeric value or a numeric vector, then the same value(s) are used for the remaining comparisons or endpoints. If Margin is not specified, the default is 1.

Author(s)

Mario Hasler

References

Hasler, M. (2014): Multiple contrast tests for multiple endpoints in the presence of heteroscedasticity. The International Journal of Biostatistics 10, 17–28.

Hasler, M. and Hothorn, L.A. (2012): A multivariate Williams-type trend procedure. Statistics in Biopharmaceutical Research 4, 57–65.

Hasler, M. and Hothorn, L.A. (2008): Multiple contrast tests in the presence of heteroscedasticity. Biometrical Journal 50, 793–800.

Dilba, G. et al. (2006): Simultaneous confidence sets and confidence intervals for multiple ratios. Journal of Statistical Planning and Inference 136, 2640–2658.

Satterthwaite, F.E. (1946): An approximate distribution of estimates of variance components. Biometrics 2, 110–114.

See Also

SimTestDiff, SimCiRat, SimCiDiff

Examples

# Example 1:
# A comparison of the groups B and H against the standard S, on endpoint
# Thromb.count, assuming unequal variances for the groups, and for ratios of
# means. This is an extension of the well-known Dunnett-test to the case of
# heteroscedasticity and in terms of ratios of means instead of differences.

data(coagulation)

comp1 <- SimTestRat(data=coagulation, grp="Group", resp="Thromb.count",
  type="Dunnett", base=3, alternative="greater", covar.equal=FALSE)
comp1

# Example 2:
# A comparison of the groups B and H against the standard S, simultaneously on
# all endpoints, assuming unequal covariance matrices for the groups, and for
# ratios of means. This is an extension of the well-known Dunnett-test to the case
# of heteroscedasticity and multiple endpoints, and in terms of ratios of means
# instead of differences.

data(coagulation)

comp2 <- SimTestRat(data=coagulation, grp="Group", resp=c("Thromb.count","ADP","TRAP"),
  type="Dunnett", base=3, alternative="greater", covar.equal=FALSE)
summary(comp2)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(SimComp)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/SimComp/SimTestRat.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SimTestRat
> ### Title: Simultaneous Tests for Ratios of Means of Multiple Endpoints
> ### Aliases: SimTestRat
> ### Keywords: htest
> 
> ### ** Examples
> 
> # Example 1:
> # A comparison of the groups B and H against the standard S, on endpoint
> # Thromb.count, assuming unequal variances for the groups, and for ratios of
> # means. This is an extension of the well-known Dunnett-test to the case of
> # heteroscedasticity and in terms of ratios of means instead of differences.
> 
> data(coagulation)
> 
> comp1 <- SimTestRat(data=coagulation, grp="Group", resp="Thromb.count",
+   type="Dunnett", base=3, alternative="greater", covar.equal=FALSE)
> comp1
 
Test for ratios of means of multiple endpoints 
Assumption: Heterogeneous covariance matrices for the groups 
Alternative hypotheses: True ratios greater than the margins 
 
  comparison     endpoint margin estimate statistic p.value.raw p.value.adj
1        B/S Thromb.count      1    1.139    1.3327      0.0997      0.1778
2        H/S Thromb.count      1    1.050    0.4244      0.3382      0.5224
 
> 
> # Example 2:
> # A comparison of the groups B and H against the standard S, simultaneously on
> # all endpoints, assuming unequal covariance matrices for the groups, and for
> # ratios of means. This is an extension of the well-known Dunnett-test to the case
> # of heteroscedasticity and multiple endpoints, and in terms of ratios of means
> # instead of differences.
> 
> data(coagulation)
> 
> comp2 <- SimTestRat(data=coagulation, grp="Group", resp=c("Thromb.count","ADP","TRAP"),
+   type="Dunnett", base=3, alternative="greater", covar.equal=FALSE)
> summary(comp2)
 
Numerator contrast matrix: 
    B H S
B/S 1 0 0
H/S 0 1 0
 
Denominator contrast matrix: 
    B H S
B/S 0 0 1
H/S 0 0 1
 
Estimated covariance matrices of the data: 
$B
             Thromb.count    ADP    TRAP
Thromb.count       0.0626 0.0565 -0.0102
ADP                0.0565 0.0638  0.0054
TRAP              -0.0102 0.0054  0.0963

$H
             Thromb.count    ADP   TRAP
Thromb.count       0.0943 0.0637 0.0663
ADP                0.0637 0.0518 0.0446
TRAP               0.0663 0.0446 0.1157

$S
             Thromb.count    ADP   TRAP
Thromb.count       0.0318 0.0132 0.0598
ADP                0.0132 0.0079 0.0269
TRAP               0.0598 0.0269 0.1376

 
Estimated correlation matrices of the data: 
$B
             Thromb.count    ADP    TRAP
Thromb.count       1.0000 0.8937 -0.1314
ADP                0.8937 1.0000  0.0687
TRAP              -0.1314 0.0687  1.0000

$H
             Thromb.count    ADP   TRAP
Thromb.count       1.0000 0.9121 0.6348
ADP                0.9121 1.0000 0.5770
TRAP               0.6348 0.5770 1.0000

$S
             Thromb.count    ADP   TRAP
Thromb.count       1.0000 0.8338 0.9033
ADP                0.8338 1.0000 0.8161
TRAP               0.9033 0.8161 1.0000

 
Estimated correlation matrix of the comparisons: 
       [,1]   [,2]   [,3]   [,4]   [,5]   [,6]
[1,] 1.0000 0.8494 0.3122 0.2833 0.1708 0.3755
[2,] 0.8494 1.0000 0.2387 0.1335 0.1158 0.1917
[3,] 0.3122 0.2387 1.0000 0.3417 0.2232 0.5550
[4,] 0.2833 0.1335 0.3417 1.0000 0.8869 0.7054
[5,] 0.1708 0.1158 0.2232 0.8869 1.0000 0.5818
[6,] 0.3755 0.1917 0.5550 0.7054 0.5818 1.0000
 
Alternative hypotheses: True ratios greater than the margins 
 
  comparison     endpoint margin estimate statistic p.value.raw p.value.adj
1        B/S Thromb.count      1    1.139    1.3327      0.0997      0.3203
2        B/S          ADP      1    1.262    2.6398      0.0106      0.0430
3        B/S         TRAP      1    1.145    0.7402      0.2337      0.5877
4        H/S Thromb.count      1    1.050    0.4244      0.3382      0.7294
5        H/S          ADP      1    1.104    1.1949      0.1258      0.3748
6        H/S         TRAP      1    1.098    0.4894      0.3147      0.7018
 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>