Heidi,

The interaction2wt function in the HH package does much of what you are
looking for.
You will probably need to download HH from CRAN.

interaction2wt {HH} R Documentation 

Plot all main effects and twoway interactions in a multifactor design
Description
The main diagonal displays boxplots for the main effects of each factor. The
off-diagonals
show the interaction plots for each pair of factors. The i,j panel shows the
same factors
as the j,i but with the trace- and x-factor roles interchanged. 


The second page of 
  example(interaction2wt)
shows the simple effects of each factor in the presence of the other.

In your example, "condition on the Y axis and year along the
X axis and four bars for each year to show mean ci for each sex and age
group".
I think
   interaction2wt(Y ~ year + interaction(sex, age), simple=TRUE,
data=yourdataframe)
will show what you are looking for.

Please send executable code to the entire list if there are followup
questions.


Rich

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to