How about this? Sconc<-matrix(c(1450,1800,1840,1820,1860,1780,1760,1800,1900, 1770,1790,1780,1850,1760,1450,1710,1575,1475,1780,1790, 1780,1450,1790,1800,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0), 24,2) Sconc.tab<-table(cut(Sconc[,1],breaks=seq(1450,1900,by=50), include.lowest=TRUE)) Sconc.cens<-table(cut(Sconc[,1][Sconc[,2]],breaks=seq(1450,1900,by=50), include.lowest=TRUE)) require(plotrix) barp(c(Sconc.tab,Sconc.cens),names.arg=c(seq(1500,1900,by=50),rep("",9)), main="Sulfate concentrations",xlab="Concentration",ylab="Frequency", x=rep(1:length(Sconc.tab),2),col=rep(c("green","red"),each=9), staxx=TRUE) legend(2,10,c("Non-censored","Censored"),fill=c("green","red"))
Jim On Fri, Jan 1, 2016 at 10:45 PM, Steven Stoline <sstol...@gmail.com> wrote: > Dear Rolf: > > > The histogram should contain a bar(s) for the censored data values replaced > by their detection limit(s) with different color than other bars for the > noncensored values . In this example there are only 3 censored values with > only one detection limit of DL = 1450. > > > with many thanks > steve > > > > On Thu, Dec 31, 2015 at 4:16 PM, Rolf Turner <r.tur...@auckland.ac.nz> > wrote: > > > On 31/12/15 23:20, Steven Stoline wrote: > > > >> Dear All: > >> > >> I need helps with creating histograms for data that include left > >> censored observations. > >> > >> Here is an example of left censored data > >> > >> > >> > >> *Sulfate.Concentration* > >> <-matrix(c(1450,1800,1840,1820,1860,1780,1760,1800,1900,1770,1790, > >> 1780,1850,1760,1450,1710,1575,1475,1780,1790,1780,1450,1790,1800, > >> 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0),24,2) > >> > >> > >> *Column 2* is an indicator for censoring "*1*" for left censored > >> observations and "*0*" for non-censored (fully measured) > >> observations. > >> > > > > And what, pray tell, do you want the resulting histogram to look like? > > See e.g. fortune("mind_read"). > > > > cheers, > > > > Rolf Turner > > > > -- > > Technical Editor ANZJS > > Department of Statistics > > University of Auckland > > Phone: +64-9-373-7599 ext. 88276 > > > > > > -- > Steven M. Stoline > 1123 Forest Avenue > Portland, ME 04112 > sstol...@gmail.com > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.