## dadrivr <dadr...@gmail.com>
## I suggest a lattice plot of all two-way interactions on the
## off-diagonals and all marginal main effects on the main diagonal.
## Please install HH and then ?interaction2wt for some examples.

## install.packages("HH")  ## if you don't already have it
library(HH)
?interaction2wt

mydata <- data.frame(id=c(1,1,1,2,2,2,3,3,3)
                     age=c(10,15,20,10,15,20,10,15,20)
                     gender=c(1,1,1,0,0,0,1,1,1)
                     happiness=c(50,30,25,70,65,80,70,40,60)
                     score=c(180,140,110,240,220,280,150,140,130))

with(mydata,interaction.plot(happiness,gender,score)) ## your first plot
with(mydata,interaction.plot(age,gender,score))          ## your second plot

## You didn't say if male is 1 or 0.  I am arbitrarily setting 0 to male
mydata$genderMF <- factor(mydata$gender, labels=c("M", "F"))

## The first plot you produced appears in the
##       score ~ age | genderMF
## panel
interaction2wt(score ~ age + genderMF, data=mydata)


## Happiness looks more like a response variable then a conditioning
## factor.  Therefore I need more information before I can make any
## suggestions about how to graph happiness.
## Rich

        [[alternative HTML version deleted]]

______________________________________________
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