[R] Removal of elements from nomograms

David Winsemius dwinsemius at comcast.net
Thu Jun 2 22:58:21 CEST 2011


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



More information about the R-help mailing list