y ~ x * t
y ~ t * x
y ~ x + t
y ~ t + x
y ~ x , groups=t
y ~ t, x=x
y ~ x * t, groups=b
y ~ t * x, groups=b
y ~ x + t, groups=b
y ~ t + x, groups=bancovaplot(object, ...)
## S3 method for class 'formula':
ancovaplot(object, data, groups=NULL, x=NULL, ...,
formula=object,
col=rep(tpg$col,
length=length(levels(as.factor(groups)))),
pch=rep(c(15,19,17,18,16,20, 0:14),
length=length(levels(as.factor(groups)))),
slope, intercept,
layout=c(length(levels(cc)), 1),
col.line=col, lty=1,
superpose.panel=TRUE,
between=if (superpose.panel)
list(x=c(rep(0, length(levels(cc))-1), 1))
else
list(x=0),
col.by.groups=FALSE ## ignored unless groups= is specified
)panel.ancova.superpose(x, y, subscripts, groups,
slope, intercept,
col, pch, ...,
col.line, lty,
superpose.panel,
col.by.groups,
condition.factor,
groups.cc.incompatible,
plot.resids=FALSE,
print.resids=FALSE,
mean.x.line=FALSE,
col.mean.x.line="gray80")
formula specifying the aov model. The function modifies it for the
xyplot specification.data.frameformula, then groups is not
needed. By default groups will be set to the treatment factor, but the
user may specify another factor for groups, usually ancovaplot.formula if the covariate is
not included in the formula.For panel.ancova.superpose, see panel.superpose.
xyplot.pch follows the value of
groups. When col.by.groups is TRUE, then
col follow the value of groups.
When col.by.groups is abline in each panel.
This is by default calculated based on the formula. The user may
override each independently.formula.panel.xyplot.TRUE (the default), there is an additional panel on
the right containing the superposition of the points and lines for all treatment levels.col.condition.factor contains a
copy of the treatment factor. groups.cc.incompatible is a
logical which is set to TRUE when the groups argument is
explicitly set byplot.resids==TRUE then vertical line segments
connecting the data points and the fitted line are drawn.
The other two arguments are interpreted only when
plot.resids==TRUEancovaplot returns a c("ancova","trellis") object.
panel.ancova.superpose is an ordinary panel function.ancova=aov specification xyplot specification abline
y ~ x * t y ~ x | t, groups=t lm(y[t] ~ x[t]) ## separate lines
y ~ t * x y ~ x | t, groups=t lm(y[t] ~ x[t]) ## separate lines
y ~ x + t y ~ x | t, groups=t lm(y ~ x + t) ## parallel lines
y ~ t + x y ~ x | t, groups=t lm(y ~ x + t) ## parallel lines
y ~ x , groups=t y ~ x | t, groups=t lm(y ~ x) ## single regression line
y ~ t, x=x y ~ x | t, groups=t mean(t) ## separate horizontal lines
y ~ x * t, groups=b y ~ x | t, groups=b lm(y[t] ~ x[t]) ## sep lines, pch&col follow b
y ~ t * x, groups=b y ~ x | t, groups=b lm(y[t] ~ x[t]) ## sep lines, pch&col follow b
y ~ x + t, groups=b y ~ x | t, groups=b lm(y ~ x + t) ## par lines, pch&col follow b
y ~ t + x, groups=b y ~ x | t, groups=b lm(y ~ x + t) ## par lines, pch&col follow b
}ancova.data(hotdog, package="HH")
ancovaplot(Sodium ~ Calories + Type, data=hotdog)
ancovaplot(Sodium ~ Calories * Type, data=hotdog)
ancovaplot(Sodium ~ Calories, groups=Type, data=hotdog)
ancovaplot(Sodium ~ Type, x=Calories, data=hotdog)
## Please see demo("ancova", package="HH") to coordinate placement
## of all four of these plots on the same page.
ancovaplot(Sodium ~ Calories + Type, data=hotdog, plot.resids=TRUE)Run the code above in your browser using DataLab