[R] histbackback function

Katie N knishimura at gmail.com
Tue Dec 8 01:14:00 CET 2009


Hi,
I'm trying to recreate a sensitivity-specificity graph using the
histbackback function.  The only problem is that these graphs are typically
drawn with vertical rather than horizontal bar plots (and the histbackback
function only seems to work with horiz=TRUE argument, using "horiz=FALSE"
doesn't work).  Does anyone know if:
1) there's a different graphing function that would accomplish this graph?
2) if there isn't, is there a way to rotate the graph 90 degrees clockwise?
3) with the histbackback function, is there a way to display percent instead
of proportion on the x-axis?
4) with the histbackback function, is there a way to set the width of the
bins (ie I want bars in increments of 10 or 20 instead of 50 , "bin=10"
didn't work)
5) with the histbackback function, is there a way to display the y-axis
values where the two histograms are back to back, rather than on the y-axis?

Below, I've pasted the graph that I'm trying to recreate, as well as the
code and graph from my current (unsuccessful) attempt.  

options(digits=1)
require(Hmisc)
out <- histbackback(split(data8$TB144, data8$PRES), probability=TRUE,
main="Back to Back Histogram", ylab="TB144 1min rates")
barplot(-out$left, col="ivory2", horiz=TRUE, space=0, add=TRUE, axes=FALSE)
barplot(out$right, col="ivory4", horiz=TRUE, space=0, add=TRUE, axes=FALSE)
grid(nx=NULL, ny = NULL, col = "lightgray", lty = "dotted", lwd =
par("lwd"), equilogs = TRUE)

http://n4.nabble.com/file/n954888/sens-spec%2Bgraph.jpg 

http://n4.nabble.com/file/n954888/back-to-back%2Bhistogram%2B2.jpg 

Thanks!
Katie
-- 
View this message in context: http://n4.nabble.com/histbackback-function-tp954888p954888.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list