Dear splus users
I wish to produce a boxplot with a log scale (because it's a
proportional difference) and with an overlaid abline (set at 1)
1. The splus boxplot command ignores log="y".
2. The splus bwplot command allows log scale via specifying
scales=(list(log=F)), but then it ignores the command abline or
panel.abline when the scale is logged.
I can achieve the plot in R using boxplot because it recognises the
log="y" option.
How do I do it in splus?
Please find code below.
Thanks for your anticipated advice.
Tri
========================================
Example code:
#Data
data<-data.frame(values=exp(rnorm(20, .2, .5)), # within-subject
proportional differences
group=rep(c("A","B"),each=10) # stratification
)
#boxplot -- fails because it ignores the log scale request
boxplot(split(data$values,data$group),log="y")
abline(h=1,lwd=1,lty=4,col=5)
# bwplot -- fails because it ignores abline
bwplot(group~values,data=data,
scales=list(x=list(log=T)),
)
abline(v=1,lwd=1,lty=4,col=5)
# bwplot -- again fails because it ignores abline
bwplot(group~values,data=data,
panel=function(x,y,...){
panel.bwplot(x,y)
panel.abline(v=1,lwd=1,lty=4,col=5)
}
)
Whereas in R, the following is successful because it recognises log="y":
boxplot(split(data$values,data$group),log="y")
abline(h=1,lwd=1,lty=4,col=5)
###
This message is for the designated recipient only and may contain privileged or
confidential information. If you have received it in error, please notify the
sender immediately and delete the original. Any other use of the email by you
is prohibited.
###
|