Hi,
I am using "bwplot" to depict the box plots for two group by 6 time
points.
I need to add 6 p-values in each time point to compare two group at each
time point. P-values are (0.0020, 0.0204, 0.3361, 0.0185, 0.1981, and
0.6677). I could depict the two box plots per each time point using the
code below, but I am not sure how to add a p-value per each time point.
Please let me know if you know how to do it.
Thanks!
library(lattice)
library(Hmisc)
library(gridExtra)
font.settings <- list( font = 1, cex = 1, fontfamily = "serif")
my.theme <- list(
box.umbrella = list(col = "black"),
box.rectangle = list(fill= rep(c("black", "black"),2)),
box.dot = list(col = "black", pch = 3, cex=2),
plot.symbol = list(cex = 0.5, col = 1, pch= 0), #outlier size and color
par.xlab.text = font.settings,
par.ylab.text = font.settings,
axis.text = font.settings,
superpose.symbol=list(fill=c("white","black")), # boxplots
superpose.polygon=list(col=c("white","black")), # legend
par.sub=font.settings)
kccqd <- sas.get("I:/Protocol/Datasets/2013/09302013/DataForQOL/",
"kccq_long",formats=F, sasprog=sasprog)
kccqlong <- subset(kccqd, month <72)
id <- (kccqlong$master.id)
group <- (kccqlong$rdrug12)
month <- (kccqlong$month)
kccq.pred <- (kccqlong$kccq.pred)
kccq.raw <- (kccqlong$kccq.raw)
bwplot(kccq.raw ~ time, data = kccqlong, groups = group, ylim=c(-100,100),
pch = "|", box.width = 1/3,
auto.key = list(points = FALSE, rectangles = TRUE, space =
"right",
title="Treatment", cex.title=1),
panel = panel.superpose,
ylab = "Change in KCCQ (Raw) from baseline",
xlab="Visit",
par.settings = my.theme,
panel.groups = function(x, y, ..., group.number) {
panel.bwplot(x + (group.number-1.5)/3, y, ...)
})
[[alternative HTML version deleted]]