vulcan <- read.table(hh("datasets/vulcan.dat"), header=TRUE)
vulcan$filler <- factor(vulcan$filler)
position(vulcan$raw) <- (1:4)+.5
position(vulcan$pretreat) <- 2:4
interaction2wt(wear ~ filler + pretreat + raw, data=vulcan)
interaction2wt(wear ~ filler + raw, data=vulcan,
simple=TRUE)
interaction2wt(wear ~ filler + raw, data=vulcan,
simple=TRUE, simple.scale=c(filler=.15, raw=.2))
if.R(r={
ToothGrowth <- ToothGrowth ## local copy
ToothGrowth$dose <- positioned(ToothGrowth$dose) ## modify local copy
print(
anova(aov(len ~ supp*dose, data=ToothGrowth))
)
print(
interaction2wt(len ~ supp + dose, data=ToothGrowth)
)
print(
bwplot(len ~ supp | unpositioned(dose), data=ToothGrowth, layout=c(3,1))
)
print(
bwplot(len ~ dose | supp, data=ToothGrowth, layout=c(2,1),
box.ratio=.5,
panel=panel.bwplot.intermediate.hh,
scales=list(x=list(at=position(ToothGrowth$dose))))
)
print(
bwplot(len ~ dose | supp, data=ToothGrowth, layout=c(2,1),
box.ratio=.5,
scales=list(x=list(at=position(ToothGrowth$dose))))
)
esoph=esoph
esoph$rate=with(esoph, ncases/ncontrols)
position(esoph$alcgp) <- 2:5
position(esoph$tobgp) <- 2:5
print(
interaction2wt(rate ~ agegp + alcgp + tobgp, esoph, rot=c(90,0))
)
esoph.aov <- aov(rate ~ agegp + alcgp + tobgp, data=esoph)
print(
anova(esoph.aov)
)
}, s={})
Run the code above in your browser using DataCamp Workspace