[R] paste ?
Bill Venables
venables at acland.qld.cmis.csiro.au
Tue Apr 25 08:45:06 CEST 2000
> As Peter helpfully pointed out mn was a vector, so here is the corrected
> version:
> bland <- function (x) #accepts two columns
> {
> mn <<- 0.5*(x[,1]+x[,2]
> diff <- x[,1]-x[,2]
> plot(mn,diff,pch=16,xlab="Mean",ylab="Difference",
> main = "Bland Altman plot",
> sub= paste("Mean = ",formatC(mean(diff),digits=3)))
> abline(h=mean(diff),lty=2)
> abline(h=mean(diff)+c(2,-2)*sqrt(var(diff)))
> }
Two small points. The line
mn <<- 0.5*(x[,1]+x[,2])
is either a mistake, or it makes this a dangerous function for
public distribution. ("Superassignment? Just say 'No'")
Secondly, I'm curious about the history of this kind of plot.
I've only heard it called a "Tukey mean difference" plot, (and
Trellis graphics has a function, tmd(), that does it, but no one
knows about it...). Does anyone know who invented it?
Bill Venables.
--
Bill Venables, Statistician, CMIS Environmetrics Project
CSIRO Marine Labs, PO Box 120, Cleveland, Qld, AUSTRALIA. 4163
Tel: +61 7 3826 7251 Email: Bill.Venables at cmis.csiro.au
Fax: +61 7 3826 7304 http://www.cmis.csiro.au/bill.venables/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list