[R] Re : Nomogram with multiple interactions (package rms)

From: Marc Carpentier <marc.carpentier_at_ymail.com>
Date: Wed, 19 May 2010 14:36:33 -0700 (PDT)

I'm sorry. I don't understand the "omit" solution, and maybe I mislead you with my explanation.

With the data from the "f" exemple of nomogram() : Let's declare :
f2 <- cph(Surv(d.time,death) ~ sex*(age+blood.pressure)) I guess the best (and maybe the only) way to represent it with a nomogram is to plot two nomograms (I couldn't find better). Is there a way to have :

Nomogram1 : "male" :

- points 1-100 ---------------
- age ("men") ---------------
- blood.pressure ("men") ---------------
- linear predictor ---------------

And nomogram2 : "female" :

- points 1-100 ---------------
- age ("female") ---------------
- blood.pressure ("female") ---------------
- linear predictor ---------------

As I said I tried and failed (nomogram() still wants me to define interact=list(...)) with :
plot(nomorgam(f2, adj.to=list(sex="male")) #and "female" for the other one

Marc

On 05/19/2010 03:17 PM, Marc Carpentier wrote:
> Dear list, I'm facing the following problem : A cox model with my sex
> variable interacting with several continuous variables :
> cph(S~sex*(x1+x2+x3)) And I'd like to make a nomogram. I know it's a
> bit tricky and one mights argue that nomogram is not a good a
> choice... I could use the parameter
> interact=list(sex=("male","female"),x1=c(a,b,c))... but with rcs or
> pol transformations of x1, x2 and x3, the choice of the
> categorization (a,b,c,...) is arbitrary and the nomogram not so
> useful... Considering that sex is the problem, I thought I could draw
> two nomograms, one for each sex... based on one model. These would be
> great. Do you think it's possible ?

Yes, you can specify constant predictors not to draw with the omit= argument. But try first to draw everything. Shouldn't you just get 2 axes each for x1 x2 x3?

>
> Taking the exemple of the help of nomogram() (package "rms") : f<-
> psm(Surv(d.time,death) ~ sex*age, dist=if(.R.)'lognormal' else
> 'gaussian')

Drop the if(.R.) which was just corrected in the documentation. Use dist='lognormal'

Frank

>
> Let's add the previously defined blood.pressure effect with an
> interaction with sex too (with cph) : f2<- cph(Surv(d.time,death) ~
> sex*(age+blood.pressure))
>
> I thought of the parameter adt.to : plot(nomorgam(f2,
> adj.to=list(sex="male")) #and "female" for the other one
>
> But nomogram() still wants me to define interact=list(...) Thanks for
> any advice you might have (with adj.to or any alternative...)
>
> Marc Carpentier
>

-- 
Frank E Harrell Jr   Professor and Chairman        School of Medicine
                      Department of Biostatistics   Vanderbilt University





______________________________________________
R-help_at_r-project.org mailing list
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.
Received on Wed 19 May 2010 - 21:42:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 19 May 2010 - 23:20:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive