intxplot | R Documentation |
Interaction plot, with an option to print standard error bars. There is an option to offset group lines to prevent the bars from overprinting.
intxplot(x, data=NULL, groups.in,
scales,
key.length=1,
key.lines,
key=TRUE,
trace.factor.name=deparse(substitute(groups.in)),
x.factor.name=x.factor,
xlab=x.factor.name,
main=list(main.title, cex=main.cex),
condition.name="condition",
panel="panel.intxplot",
summary.function="sufficient",
se,
...,
data.is.summary=FALSE,
main.title=paste(
"Interactions of", trace.factor.name, "and",
x.factor.name,
if (length(x[[3]]) > 1)
paste("|", condition.name.to.use)),
main.cex=1.5,
col, lwd, lty, alpha)
panel.intxplot(x, y, subscripts, groups, type = "l", se, cv=1.96,
offset.use=(!missing(groups) && !missing(se)),
offset.scale=2*max(as.numeric(groups)),
offset=
as.numeric(groups[match(levels(groups), groups)]) / offset.scale,
rug.use=offset.use,
col, lwd, lty, alpha,
...)
x |
For |
data |
data.frame, as used in |
groups.in |
|
scales |
Optional, additional arguments for the standard |
key.length |
Number of columns in the key. |
key.lines |
default value for the |
key |
logical. If |
trace.factor.name |
Name of the grouping variable. |
x.factor.name |
name of the dependent variable. |
xlab |
as in |
main |
as in |
panel |
as in |
condition.name |
name of the conditioning variable. |
summary.function |
The default |
se |
standard errors to be passed to |
,
... |
In |
data.is.summary |
logical, defaults to |
main.title |
Default main title for plot. |
main.cex |
Default character expansion for main title. |
y , subscripts , groups , type |
Standard arguments for panel functions. |
cv |
critical value for confidence intervals. Defaults to 1.96. |
offset.use |
logical. If |
offset.scale |
Scale number indicating how far apart the ends of the groups will be placed. Larger numbers make them closer together. |
offset |
Actual numbers by which the end of the groups are offset
from their nominal location which is the |
rug.use |
logical. If |
col , lwd , lty , alpha |
Arguments to
|
"trellis"
object.
Richard M. Heiberger <rmh@temple.edu>
sufficient
## This uses the same data as the HH Section 12.13 rhizobium example.
data(rhiz.clover)
## interaction plot, no SE
intxplot(Npg ~ strain, groups=comb, data=rhiz.clover,
main="Interaction Plot. No SE")
## interaction plot, individual SE for each treatment combination
## Rescaled to allow the CI bars to stay within the plot region
intxplot(Npg ~ strain, groups=comb, data=rhiz.clover, se=TRUE,
ylim=c(17,47),
main="Interaction Plot. Rescaled to keep CI bars within the plot region")
## Common SE based on ANOVA table. Rescaled to allow the CI bars to stay within the plot region
intxplot(Npg ~ strain, groups=comb, data=rhiz.clover,
se=sqrt(sum((nobs-1)*sd^2)/(sum(nobs-1)))/sqrt(5),
ylim=c(16,41),
main=paste("Interaction Plot. Common SE based on ANOVA table.\n",
"Rescaled to keep CI bars within the plot region"))
## change distance between endpoints
intxplot(Npg ~ strain, groups=comb, data=rhiz.clover, se=TRUE,
offset.scale=10, ylim=c(18,46),
main="Interaction plot. Change distance between endpoints")
## When data includes the nobs and sd variables, data.is.summary=TRUE is needed.
intxplot(Npg ~ strain, groups=comb,
se=sqrt(sum((nobs-1)*sd^2)/(sum(nobs-1)))/sqrt(5),
data=sufficient(rhiz.clover, y="Npg", c("strain","comb")),
data.is.summary=TRUE,
ylim=c(16,41),
main=paste("Interaction plot. When data includes the nobs and sd variables,\n",
"'data.is.summary=TRUE' is needed"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.