id <-
c(17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24,
24,24,25,25,25,26,26,26)
age <- rep(c(30,36,42),10)
outcome <-
c(12,17,10,5,5,2,NA,NA,NA,8,6,5,11,13,10,15,11,15,13,NA,9,0,0,0,20,
14,16,1,2,2)
mydata <- as.data.frame(cbind(id,age,outcome))
interaction.plot(mydata$age, mydata$id, mydata$outcome, fun = mean,
legend
= FALSE, lty = 1, xtick = TRUE, type = "l")
How can I make the 'mean' summary line red and thicker?
On Sep 7, 2011, at 4:49 PM, dadrivr wrote:
David Winsemius wrote:
What "mean summary line"? I count 8 lines and that matches the
number
if id's with complete data.
Yea, I don't know why there is no mean summary line showing up. I
requested
it in the interaction.plot statement (fun = mean), and I don't get
any
errors.
You didn't get any errors and you _did_ get the means. It's just that
you only gave it a dataset that had only one value per category. The
mean is defined for a single element vector although the sd and var
are not. Look more closely at the example on the help page and you
will see that it has more than one value per category defined by the
two interaction variables