mmcm.mvt {mmcm} | R Documentation |
The modified maximum contrast method by using randomized quasi-Monte Carlo method
Description
This function gives -value for the modified maximum contrast statistics
by using randomized quasi-Monte Carlo method from
pmvt
function of package mvtnorm
.
Usage
mmcm.mvt(
x,
g,
contrast,
alternative = c("two.sided", "less", "greater"),
algorithm = GenzBretz()
)
Arguments
x |
a numeric vector of data values |
g |
a integer vector giving the group for the corresponding elements of x |
contrast |
a numeric contrast coefficient matrix for modified maximum contrast statistics |
alternative |
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter. |
algorithm |
an object of class |
Details
mmcm.mvt
performs the modified maximum contrast method
that is detecting a true response pattern under the unequal sample size situation.
is an observed response for
-th individual in
-th group.
is coefficient matrix for modified maximum contrast statistics
(
matrix,
: No. of groups,
: No. of pattern).
is coefficient vector of
th pattern.
is the modified maximum contrast statistic.
Consider testing the overall null hypothesis ,
versus alternative hypotheses
for response petterns
(
). The
-value for the probability distribution
of
under the overall null hypothesis is
is observed value of statistics.
This function gives distribution of
by using randomized
quasi-Monte Carlo method from package
mvtnorm
.
Value
statistic |
the value of the test statistic with a name describing it. |
p.value |
the p-value for the test. |
alternative |
a character string describing the alternative hypothesis. |
method |
the type of test applied. |
contrast |
a character string giving the names of the data. |
contrast.index |
a suffix of coefficient vector of the |
error |
estimated absolute error and, |
msg |
status messages. |
References
Nagashima, K., Sato, Y., Hamada, C. (2011). A modified maximum contrast method for unequal sample sizes in pharmacogenomic studies Stat Appl Genet Mol Biol. 10(1): Article 41. http://dx.doi.org/10.2202/1544-6115.1560
Sato, Y., Laird, N.M., Nagashima, K., et al. (2009). A new statistical screening approach for finding pharmacokinetics-related genes in genome-wide studies. Pharmacogenomics J. 9(2): 137–146. http://www.ncbi.nlm.nih.gov/pubmed/19104505
See Also
Examples
## Example 1 ##
# true response pattern: dominant model c=(1, 1, -2)
set.seed(136885)
x <- c(
rnorm(130, mean = 1 / 6, sd = 1),
rnorm( 90, mean = 1 / 6, sd = 1),
rnorm( 10, mean = -2 / 6, sd = 1)
)
g <- rep(1:3, c(130, 90, 10))
boxplot(
x ~ g,
width = c(length(g[g==1]), length(g[g==2]), length(g[g==3])),
main = "Dominant model (sample data)",
xlab = "Genotype", ylab="PK parameter"
)
# coefficient matrix
# c_1: additive, c_2: recessive, c_3: dominant
contrast <- rbind(
c(-1, 0, 1), c(-2, 1, 1), c(-1, -1, 2)
)
y <- mmcm.mvt(x, g, contrast)
y
## Example 2 ##
# for dataframe
# true response pattern:
# pos = 1 dominant model c=( 1, 1, -2)
# 2 additive model c=(-1, 0, 1)
# 3 recessive model c=( 2, -1, -1)
set.seed(3872435)
x <- c(
rnorm(130, mean = 1 / 6, sd = 1),
rnorm( 90, mean = 1 / 6, sd = 1),
rnorm( 10, mean = -2 / 6, sd = 1),
rnorm(130, mean = -1 / 4, sd = 1),
rnorm( 90, mean = 0 / 4, sd = 1),
rnorm( 10, mean = 1 / 4, sd = 1),
rnorm(130, mean = 2 / 6, sd = 1),
rnorm( 90, mean = -1 / 6, sd = 1),
rnorm( 10, mean = -1 / 6, sd = 1)
)
g <- rep(rep(1:3, c(130, 90, 10)), 3)
pos <- rep(c("rsXXXX", "rsYYYY", "rsZZZZ"), each=230)
xx <- data.frame(pos = pos, x = x, g = g)
# coefficient matrix
# c_1: additive, c_2: recessive, c_3: dominant
contrast <- rbind(
c(-1, 0, 1), c(-2, 1, 1), c(-1, -1, 2)
)
y <- by(xx, xx$pos, function(x) mmcm.mvt(x$x, x$g,
contrast))
y <- do.call(rbind, y)[,c(3,7,9)]
y