The R Project SVN R

Rev

Rev 27442 | Rev 30552 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27442 Rev 30449
Line 66... Line 66...
66
  Chapter 5 of \emph{Statistical Models in S}
66
  Chapter 5 of \emph{Statistical Models in S}
67
  eds J. M. Chambers and T. J. Hastie, Wadsworth \& Brooks/Cole.
67
  eds J. M. Chambers and T. J. Hastie, Wadsworth \& Brooks/Cole.
68
}
68
}
69
 
69
 
70
\examples{
70
\examples{
71
data(ToothGrowth)
-
 
72
attach(ToothGrowth)
71
attach(ToothGrowth)
73
interaction.plot(dose, supp, len, fixed=TRUE)
72
interaction.plot(dose, supp, len, fixed=TRUE)
74
dose <- ordered(dose)
73
dose <- ordered(dose)
75
interaction.plot(dose, supp, len, fixed=TRUE, col = 2:3, leg.bty = "o")
74
interaction.plot(dose, supp, len, fixed=TRUE, col = 2:3, leg.bty = "o")
76
detach()
75
detach()
77
 
76
 
78
data(OrchardSprays)
-
 
79
with(OrchardSprays, {
77
with(OrchardSprays, {
80
  interaction.plot(treatment, rowpos, decrease)
78
  interaction.plot(treatment, rowpos, decrease)
81
  interaction.plot(rowpos, treatment, decrease, cex.axis=0.8)
79
  interaction.plot(rowpos, treatment, decrease, cex.axis=0.8)
82
  ## order the rows by their mean effect
80
  ## order the rows by their mean effect
83
  rowpos <- factor(rowpos, levels=sort.list(tapply(decrease, rowpos, mean)))
81
  rowpos <- factor(rowpos, levels=sort.list(tapply(decrease, rowpos, mean)))
84
  interaction.plot(rowpos, treatment, decrease, col = 2:9, lty = 1)
82
  interaction.plot(rowpos, treatment, decrease, col = 2:9, lty = 1)
85
})
83
})
86
 
84
 
87
data(esoph)
-
 
88
with(esoph, {
85
with(esoph, {
89
  interaction.plot(agegp, alcgp, ncases/ncontrols)
86
  interaction.plot(agegp, alcgp, ncases/ncontrols)
90
  interaction.plot(agegp, tobgp, ncases/ncontrols, trace.label="tobacco",
87
  interaction.plot(agegp, tobgp, ncases/ncontrols, trace.label="tobacco",
91
		   fixed=TRUE, xaxt = "n")
88
		   fixed=TRUE, xaxt = "n")
92
})
89
})