Learn R Programming

mratios (version 1.4.2)

simtest.ratioVH: Approximate simultaneous tests for ratios of normal means with heterogeneous variances

Description

Performs simultaneous tests for several ratios of linear combinations of treatment means in a normal one-way layout, assuming normal distribution of the data allowing heterogeneous variances.

Usage

simtest.ratioVH(formula, data,
 type = "Dunnett", base = 1, alternative = "two.sided",
 Margin.vec = NULL, FWER = 0.05,
 Num.Contrast = NULL, Den.Contrast = NULL,
 names = TRUE)

Arguments

formula

A formula specifying a numerical response and a grouping factor (e.g., response ~ treatment)

data

A dataframe containing the response and group variable

type

type of contrast, with the following options:

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

  • "Tukey": all-pair comparisons

  • "Sequen": comparison 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

  • "Changepoint": ratio 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

Note: 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 the Dunnett contrasts, ignored otherwise

alternative

a character string:

  • "two.sided": for two-sided tests

  • "less": for lower tail tests

  • "greater": for upper tail tests

Margin.vec

a single numerical value or vector of Margins under the null hypotheses, default is 1

FWER

a single numeric value specifying the family-wise error rate to be controlled

Num.Contrast

Numerator contrast matrix, where columns correspond to groups and rows correspond to contrasts

Den.Contrast

Denominator contrast matrix, where columns correspond to groups and rows correspond to contrasts

names

a logical value: if TRUE, the output will be named according to names of user defined contrast or factor levels

Value

An object of class simtest.ratio containing:

estimate

a (named) vector of estimated ratios

teststat

a (named) vector of the calculated test statistics

Num.Contrast

the numerator contrast matrix

Den.Contrast

the denominator contrast matrix

CorrMat

the correlation matrix of the multivariate t-distribution calculated under the null hypotheses

critical.pt

the equicoordinate critical value of the multi-variate t-distribution for a specified FWER

p.value.raw

a (named) vector of unadjusted p-values

p.value.adj

a (named) vector of p-values adjusted for multiplicity

Margin.vec

the vector of margins under the null hypotheses

and some other input arguments.

Details

The associated ratio test statistic T[i] has a t-distribution. Multiplicity adjustment is achieved by using quantiles of r r-variate t-distributions, which differ in the degree of freedom and share the correlation structure. The compariso-specific degrees of freedom are derived using the approximation according to Satterthwaite (1946).

References

Simultaneous tests (adjusted p-values)

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

Unadjusted tests (raw p-values)

Hasler M, Vonk R, Hothorn LA (2007). Assessing non-inferiority of a new treatment in a three-arm trial in the presence of heteroscedasticity. Statistics in Medicine 27, 490-503.

Satterthwaite, FE (1946). An approximate distribution of estimates of variance components. Biometrics 2, 110-114.

See Also

sci.ratioVH for corresponding confidence intervals

Examples

Run this code
# NOT RUN {
###############################################

data(Mutagenicity, package="mratios")

boxplot(MN~Treatment, data=Mutagenicity)

# }
# NOT RUN {
simtest.ratioVH(MN~Treatment, data=Mutagenicity,
 type="Dunnett", base=6, Margin.vec=1.2, alternative="less")

###############################################

# Unadjusted confidence intervals for multiple ratios
# of means assuming heterogeneous group variances.
# The following code produces the results given in Table
# V of Hasler, Vonk and Hothorn (2007).
# The upper confidence limits in Table V can produced
# by calling:

# Mutagenicity of the doses of the new compound,
# expressed as ratio (DoseX-Vehicle)/(Cyclo25-Vehicle):

# Check the order of the factor levels:

levels(Mutagenicity$Treatment)

# numerators:

NC<-rbind(
"Hydro30-Vehicle"=c(0,0,1,0,0,-1),
"Hydro50-Vehicle"=c(0,0,0,1,0,-1),
"Hydro75-Vehicle"=c(0,0,0,0,1,-1),
"Hydro100-Vehicle"=c(0,1,0,0,0,-1)
)

DC<-rbind(
"Cyclo25-Vehicle"=c(1,0,0,0,0,-1),
"Cyclo25-Vehicle"=c(1,0,0,0,0,-1),
"Cyclo25-Vehicle"=c(1,0,0,0,0,-1),
"Cyclo25-Vehicle"=c(1,0,0,0,0,-1)
)

colnames(NC)<-colnames(DC)<-levels(Mutagenicity$Treatment)

NC

DC

# The raw p-values are those presented in Table V:

simtest.ratioVH(formula=MN~Treatment, data=Mutagenicity,
 Num.Contrast=NC, Den.Contrast=DC,
 alternative="less", Margin.vec=0.5, FWER=0.05)
# }

Run the code above in your browser using DataLab