[R] Change properties of line summary in interaction.plot
dadrivr at gmail.com
Thu Sep 8 00:31:00 CEST 2011
Here's an example:
> id <- c(17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,23,23,23,24,
> age <- rep(c(30,36,42),10)
> outcome <-
> 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?
David Winsemius wrote:
> 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
>> it in the interaction.plot statement (fun = mean), and I don't get any
> 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
Okay, I checked the example, and I see what you mean. Is there a way to
compute an average trajectory (i.e., a line that represents the averages of
all the other lines) and make that line red? Obviously, I'm fairly new to
this in general, so any guidance would be helpful.
View this message in context: http://r.789695.n4.nabble.com/Change-properties-of-line-summary-in-interaction-plot-tp3788614p3797431.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help