The R Project SVN R

Rev

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

Rev 47262 Rev 47616
Line 95... Line 95...
95
})
95
})
96
 
96
 
97
with(esoph, {
97
with(esoph, {
98
  interaction.plot(agegp, alcgp, ncases/ncontrols, main = "'esoph' Data")
98
  interaction.plot(agegp, alcgp, ncases/ncontrols, main = "'esoph' Data")
99
  interaction.plot(agegp, tobgp, ncases/ncontrols, trace.label="tobacco",
99
  interaction.plot(agegp, tobgp, ncases/ncontrols, trace.label="tobacco",
100
		   fixed=TRUE, xaxt = "n")
100
                   fixed=TRUE, xaxt = "n")
101
})
101
})
102
## deal with NAs:
102
## deal with NAs:
103
esoph[66,] # second to last age group: 65-74
103
esoph[66,] # second to last age group: 65-74
104
esophNA <- esoph; esophNA$ncases[66] <- NA
104
esophNA <- esoph; esophNA$ncases[66] <- NA
105
with(esophNA, {
105
with(esophNA, {
106
  interaction.plot(agegp, alcgp, ncases/ncontrols, col= 2:5)
106
  interaction.plot(agegp, alcgp, ncases/ncontrols, col= 2:5)
107
				# doesn't show *last* group either
107
                                # doesn't show *last* group either
108
  interaction.plot(agegp, alcgp, ncases/ncontrols, col= 2:5, type = "b")
108
  interaction.plot(agegp, alcgp, ncases/ncontrols, col= 2:5, type = "b")
109
  ## alternative take non-NA's  {"cheating"}
109
  ## alternative take non-NA's  {"cheating"}
110
  interaction.plot(agegp, alcgp, ncases/ncontrols, col= 2:5,
110
  interaction.plot(agegp, alcgp, ncases/ncontrols, col= 2:5,
111
                   fun = function(x) mean(x, na.rm=TRUE),
111
                   fun = function(x) mean(x, na.rm=TRUE),
112
                   sub = "function(x) mean(x, na.rm=TRUE)")
112
                   sub = "function(x) mean(x, na.rm=TRUE)")