Dear R users:
I have a continuous outcome variable and four predictors, two continuous and
two dichotomous. i would like to use the lattice plot to create scatter
plots for the continuous predictors and boxplots for the dichotomous
predictors.
with 4 continuous variables, this is what i have been
Dear R users:
I have a continuous outcome variable and four predictors, two continuous and
two dichotomous. i would like to use the lattice plot to create scatter
plots for the continuous predictors and boxplots for the dichotomous
predictors.
with 4 continuous variables, this is what i have been
i appreciate all the interest in my question, and thank you Elai for both of
your suggestions, which work very well.
Elai, your last code was particularly simple and helpful to generate the
figure i was looking for.
x11(height=8,width=11)
par(lend=2)
xdat = data.frame(mortality =c(5,
8,7,5,8,10,11
Thank you David, the bwplot option does what I need:
x11(height=8,width=11)
bwplot ( mortality~ attend|type,
pch=95,cex=5,col=2,
par.settings=list(
box.rectangle = list(col = "transparent"),
box.umbrella = list(col = "transparent"),
plot.symbol = list(col = "transparent")
),
panel=functi
here is the data (fyi this is made-up data)
x = as.data.frame (
cbind(c(5,8,7,5,8,10,11,6,4,5,20,25,27,30,35,32,28,21,20,34,11,15,18,12,15,12,10,15,19,20),
c(1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3),c(1,0,1,1,1,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,0,0)))
names(x)=c("mo
i am trying to replicate the following graph using xyplot :
attach(x)
plot ( jitter(type), mortality, pch=16, xlim = c(0.25, 3.75))
lines ( c(1-0.375,1.375) , c ( median(mortality[type==1]),
median(mortality[type==1])), lwd=5,col=2)
lines ( c(2-0.375,2.375) , c ( median(mortality[type==2]),
media
6 matches
Mail list logo