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 syntax similar to raw.means.plot2
.
1 2 3 4 5 |
data |
A |
col.id |
|
col.offset |
|
col.x |
|
col.value |
|
fun.aggregate |
Function or function name used for aggregating the results. Default is |
ref.offset |
Scalar |
prefixes |
|
test |
character of length 1, which test to use. currently implemented are |
alternative |
same as in |
distribution |
|
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 raw.means.plot2
and should be used in addition to it. Note that values are ordered according to the col.id
so paired = TRUE
should be fine.
axis is plotted.
Henrik Singmann
raw.means.plot
as the accompanying main functions.
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 examples from raw.means.plot
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!
raw.means.plot2(OBK.long, "id", "measurement", "gender", "value")
add.ps(OBK.long, "id", "measurement", "gender", "value", paired = TRUE) #reference is "fup"
raw.means.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)
raw.means.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
raw.means.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.