Description Usage Arguments Details Value Author(s) See Also Examples
Adds p-values comparing the different cells at each x-axis position with a reference cell. Uses a syntex similar to rm.plot2
.
1 2 3 4 |
d |
A |
col.id |
|
col.offset |
|
col.x |
|
col.d |
|
fun.aggregate |
Function or function name used for aggregating the results. Default is |
ref.offset |
Scalar |
prefixes |
|
alternative |
same as in |
mu |
same as in |
paired |
same as in |
var.equal |
same as in |
lty |
line type of axis, Default is 0 (i.e., no line). |
... |
further arguments passed to axis. |
This function computes t-tests comparing the values at each x-axis position for each condition against the reference condition at and adds the p-values to the axis.
This functions uses the same syntax as rm.plot2
and should be used in addition to it. Note that values are ordered according to the id.col
so paired = TRUE
should be fine.
axis is plotted.
Henrik Singmann
rm.plot2
as the accompanying function or rm.plot
for the main function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
#The examples uses the OBrienKaiser dataset from car and needs reshape.
# This extends the example sfrom rm.plot2
require(reshape)
require(car)
data(OBrienKaiser)
OBKnew <- cbind(factor(1:nrow(OBrienKaiser)), OBrienKaiser)
colnames(OBKnew)[1] <- "id"
OBK.long <- melt(OBKnew)
OBK.long[, c("measurement", "time")] <- t(vapply(strsplit(as.character(OBK.long$variable), "\\."), "[", c("", "")))
# For this example the position at each x-axis are within-subject comparisons!
rm.plot2(OBK.long, "id", "measurement", "gender", "value")
add.ps(OBK.long, "id", "measurement", "gender", "value", paired = TRUE) #reference is "fup"
rm.plot2(OBK.long, "id", "measurement", "gender", "value")
add.ps(OBK.long, "id", "measurement", "gender", "value", ref.offset = 2, paired = TRUE) #reference is "post"
# Use R's standard (i.e., Welch test)
rm.plot2(OBK.long, "id", "treatment", "gender", "value")
add.ps(OBK.long, "id", "treatment", "gender", "value", prefixes = c("p(control vs. A)", "p(control vs. B)"))
# Use standard t-test
rm.plot2(OBK.long, "id", "treatment", "gender", "value")
add.ps(OBK.long, "id", "treatment", "gender", "value", var.equal = TRUE, prefixes = c("p(control vs. A)", "p(control vs. B)"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.