data(simdat)
m1 <- bam(Y ~ Group + te(Time, Trial, by=Group),
data=simdat)
plot_diff(m1, view='Time', comp=list(Group=c("Children", "Adults")))
# Reversed y-axis (for EEG data):
plot_diff(m1, view='Time', comp=list(Group=c("Children", "Adults")),
eegAxis=TRUE)
# retrieving plot values...
out <- plot_diff(m1, view='Time', comp=list(Group=c("Children", "Adults")),
plot=FALSE)
#... which might be used for indicating differences:
x <- find_difference(out$est, out$se, f=1.96, xVals=out$xVals)
# add lines:
arrows(x0=x$start, x1=x$end, y0=0, y1=0,code=3, length=.1, col='red')
# see the vignette for examples:
vignette("plotfunctions", package="itsadug")
Run the code above in your browser using DataLab