The rms package includes the nomogram function, which generates a list object that can be passed to plot for graphical production of nomograms. I would like to remove the "linear predictor" line in the graph, which means (I suspect) removing it from the nomogram output object. I've looked at the nomogram output object, but it is not clear to me if or how it might be edited to remove the linear predictor content. Similarly , I do not see how to coax nomogram() into not producing this output in the first place. As ever, thanks in advance are likely due to Frank Harrell, without whom many things would be much more difficult.
The documentation includes this: nomogram(fit, ..., lp=FALSE) Frank Rob James-2 wrote:> > The rms package includes the nomogram function, which generates a list > object that can be passed to plot for graphical production of nomograms. > > I would like to remove the "linear predictor" line in the graph, which > means (I suspect) removing it from the nomogram output object. I've > looked at the nomogram output object, but it is not clear to me if or > how it might be edited to remove the linear predictor content. Similarly > , I do not see how to coax nomogram() into not producing this output > in the first place. > > As ever, thanks in advance are likely due to Frank Harrell, without whom > many things would be much more difficult. > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: r.789695.n4.nabble.com/Removal-of-elements-from-nomograms-tp3569301p3569364.html Sent from the R help mailing list archive at Nabble.com.
On Jun 2, 2011, at 4:19 PM, Rob James wrote:> The rms package includes the nomogram function, which generates a > list object that can be passed to plot for graphical production of > nomograms. > > I would like to remove the "linear predictor" line in the graph, > which means (I suspect) removing it from the nomogram output > object. I've looked at the nomogram output object, but it is not > clear to me if or how it might be edited to remove the linear > predictor content. Similarly , I do not see how to coax nomogram() > into not producing this output in the first place.Setting the "lp" element to NULL would remove it from the object, but ... why? The plot and print functions depend on it, so your goals need a better elaboration. If you want to suppress plotting of the "lp" then looking at the code it appears that the plot.nomogram function uses the "info" attributes and a bit of experimentation shows that this surgery allows plotting of a nomogram without the Linear Predictor" line: > attr(nom, "info")$lp <- FALSE > plot(nom, xfrac=.45) At least with the first example in the help(nomogram) page it does not seem to do violence to the result. And looking again at the help page, I see it is the fourth argument, so you could have just done it in the nomogram call with nomogram( ......... , lp=FALSE).> > As ever, thanks in advance are likely due to Frank Harrell, without > whom many things would be much more difficult.But he cannot sit at our shoulders and read the help page to us it would seem. -- David Winsemius, MD West Hartford, CT