log log plots for cox regression

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

log log plots for cox regression

bgreen
Hello,

I am hoping for some advice regarding how I can generate multiple log
log plots to test the assumption of proportional hazards.

'PLOT LML' only will plot one covariate at a time. Is there a way to
select multiple variables so that the plots for all the covariates
(e.g bar1, var2, etc) can be produced?

Any assistance is appreciated,

Bob

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: log log plots for cox regression

Marta Garcia-Granero
Bob Green wrote:
> I am hoping for some advice regarding how I can generate multiple log
> log plots to test the assumption of proportional hazards.
>
> 'PLOT LML' only will plot one covariate at a time. Is there a way to
> select multiple variables so that the plots for all the covariates
> (e.g var1, var2, etc) can be produced?
>
Not with the Point&Click, but it can be done with syntax. SelectLML plot
for one of the covariates, and click Paste insteadof OK. modify the
syntxby adding and extra "/PATTERN bY..." subcommand. See example below.

*****************************************************************
*                     EXAMPLE DATASET                           *
* Table 9.1 Biostatistical Methods in Epidemiology (pp 177-178) *
* Stephen C Newman (2001); JOHN WILEY&SONS                      *
*****************************************************************.
DATA LIST FREE/FuTime Event stage reclevel (4 F8.0).
BEGIN DATA
50 0 1 1 51 1 1 1 51 0 1 1 53 0 1 1 53 0 1 1 54 0 1 1
54 0 1 1 55 0 1 1 56 1 1 1 56 0 1 1 57 0 1 1 60 0 1 1
10 1 1 2 34 1 1 2 34 0 1 2 47 1 1 2 47 1 1 2 49 0 1 2
49 0 1 2 50 0 1 2 50 0 1 2 50 0 1 2 50 0 1 2 50 0 1 2
50 0 1 2 50 0 1 2 51 0 1 2 51 0 1 2 51 0 1 2 51 0 1 2
51 0 1 2 51 0 1 2 52 0 1 2 52 0 1 2 52 0 1 2 52 0 1 2
52 0 1 2 53 0 1 2 53 0 1 2 53 0 1 2 53 0 1 2 53 0 1 2
53 0 1 2 54 0 1 2 54 0 1 2 54 0 1 2 54 0 1 2 54 0 1 2
55 0 1 2 55 0 1 2 56 0 1 2 56 0 1 2 57 0 1 2 57 0 1 2
57 0 1 2 57 0 1 2 57 0 1 2 58 0 1 2 58 0 1 2 58 0 1 2
58 0 1 2 58 0 1 2 59 0 1 2 59 0 1 2 59 0 1 2 59 0 1 2
60 0 1 2 60 0 1 2 60 0 1 2  4 0 2 1  9 1 2 1 13 1 2 1
21 1 2 1 29 1 2 1 29 1 2 1 40 1 2 1 46 1 2 1 49 0 2 1
49 0 2 1 52 0 2 1 52 0 2 1 53 0 2 1 54 0 2 1 55 0 2 1
55 0 2 1 56 0 2 1 57 1 2 1 57 0 2 1 58 0 2 1 58 0 2 1
59 0 2 1 60 0 2 1 11 1 2 2 16 1 2 2 21 1 2 2 23 1 2 2
23 1 2 2 24 1 2 2 33 1 2 2 33 1 2 2 36 1 2 2 36 1 2 2
36 0 2 2 37 1 2 2 45 1 2 2 46 1 2 2 49 0 2 2 49 0 2 2
50 0 2 2 50 0 2 2 50 0 2 2 50 0 2 2 50 0 2 2 50 0 2 2
51 0 2 2 51 0 2 2 51 0 2 2 51 0 2 2 52 0 2 2 52 0 2 2
52 0 2 2 52 0 2 2 52 0 2 2 53 0 2 2 53 0 2 2 53 0 2 2
53 0 2 2 53 0 2 2 54 0 2 2 54 0 2 2 54 0 2 2 54 0 2 2
55 0 2 2 55 0 2 2 55 0 2 2 55 0 2 2 56 0 2 2 56 0 2 2
56 0 2 2 56 0 2 2 56 0 2 2 56 0 2 2 57 0 2 2 57 0 2 2
57 0 2 2 57 0 2 2 58 1 2 2 58 1 2 2 58 0 2 2 58 0 2 2
58 0 2 2 58 0 2 2 58 0 2 2 58 0 2 2 58 0 2 2 58 0 2 2
59 0 2 2 59 0 2 2 59 0 2 2 59 0 2 2 59 0 2 2 60 0 2 2
60 0 2 2 60 0 2 2 60 0 2 2 60 0 2 2 60 0 2 2  9 1 3 1
12 1 3 1 14 1 3 1 15 1 3 1 15 0 3 1 17 1 3 1 21 1 3 1
22 1 3 1 23 1 3 1 23 1 3 1 31 1 3 1 34 1 3 1 35 1 3 1
53 0 3 1 60 0 3 1  7 0 3 2  9 1 3 2 17 1 3 2 21 0 3 2
22 1 3 2 22 1 3 2 34 1 3 2 34 1 3 2 41 1 3 2 49 0 3 2
52 0 3 2 55 1 3 2 56 0 3 2 58 0 3 2 58 0 3 2 59 0 3 2
59 0 3 2
END DATA.
VAR LABEL stage' Tumour Stage'/ reclevel 'Receptor level'
/FuTime 'Survival time (months)' /Event 'Censoring Status'.
VALUE label stage 1'I' 2'II' 3'III'
 /reclevel 1'Low' 2'High' /Event 0'Censored' 1'Event'.

* LML plots for both covariates *.
COXREG FuTime
  /STATUS=Event(1)
  /PATTERN BY stage
  /PATTERN BY reclevel
  /CONTRAST (reclevel)=Indicator(1)
  /CONTRAST (stage)=Indicator(1)
  /METHOD=ENTER stage reclevel
  /PLOT LML.



Marta

--
For miscellaneous statistical stuff, visit:
http://gjyp.nl/marta/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: log log plots for cox regression

Marta Garcia-Granero
Just an afterthought (well two, to be more precise)

1) Forgive my awful syntax: I have a new silicon keyboard with a funny
temperament, and it simply refuses, at random, to type some "a" and some
blanks (shift key is also a bit lacy). I like the keyboard because it
doesn't make any noise (and it's not affected by my teacup-dropping
habit), but I'm considering switching back to my old "clank-noises" one,
unless I learn how to make it write everything I actually type.

2) Now, the important question: are you aware that SPSS will give you
the estimated LML plots, not the observed? There is a trick for getting
the true (observed) LML plots, just in case you are interested (it
involves splitting the dataset by the covariate, not using it in the
model, and asking for LML plot at mean of covariates).

Marta

(losing a lot of time checking what I write)

> Bob Green wrote:
>> I am hoping for some advice regarding how I can generate multiple log
>> log plots to test the assumption of proportional hazards.
>>
>> 'PLOT LML' only will plot one covariate at a time. Is there a way to
>> select multiple variables so that the plots for all the covariates
>> (e.g var1, var2, etc) can be produced?
>>
> Not with the Point&Click, but it can be done with syntax. SelectLML
> plot for one of the covariates, and click Paste insteadof OK. modify
> the syntxby adding and extra "/PATTERN bY..." subcommand. See example
> below.
>
> *****************************************************************
> *                     EXAMPLE DATASET                           *
> * Table 9.1 Biostatistical Methods in Epidemiology (pp 177-178) *
> * Stephen C Newman (2001); JOHN WILEY&SONS                      *
> *****************************************************************.
> DATA LIST FREE/FuTime Event stage reclevel (4 F8.0).
> BEGIN DATA
> 50 0 1 1 51 1 1 1 51 0 1 1 53 0 1 1 53 0 1 1 54 0 1 1
> 54 0 1 1 55 0 1 1 56 1 1 1 56 0 1 1 57 0 1 1 60 0 1 1
> 10 1 1 2 34 1 1 2 34 0 1 2 47 1 1 2 47 1 1 2 49 0 1 2
> 49 0 1 2 50 0 1 2 50 0 1 2 50 0 1 2 50 0 1 2 50 0 1 2
> 50 0 1 2 50 0 1 2 51 0 1 2 51 0 1 2 51 0 1 2 51 0 1 2
> 51 0 1 2 51 0 1 2 52 0 1 2 52 0 1 2 52 0 1 2 52 0 1 2
> 52 0 1 2 53 0 1 2 53 0 1 2 53 0 1 2 53 0 1 2 53 0 1 2
> 53 0 1 2 54 0 1 2 54 0 1 2 54 0 1 2 54 0 1 2 54 0 1 2
> 55 0 1 2 55 0 1 2 56 0 1 2 56 0 1 2 57 0 1 2 57 0 1 2
> 57 0 1 2 57 0 1 2 57 0 1 2 58 0 1 2 58 0 1 2 58 0 1 2
> 58 0 1 2 58 0 1 2 59 0 1 2 59 0 1 2 59 0 1 2 59 0 1 2
> 60 0 1 2 60 0 1 2 60 0 1 2  4 0 2 1  9 1 2 1 13 1 2 1
> 21 1 2 1 29 1 2 1 29 1 2 1 40 1 2 1 46 1 2 1 49 0 2 1
> 49 0 2 1 52 0 2 1 52 0 2 1 53 0 2 1 54 0 2 1 55 0 2 1
> 55 0 2 1 56 0 2 1 57 1 2 1 57 0 2 1 58 0 2 1 58 0 2 1
> 59 0 2 1 60 0 2 1 11 1 2 2 16 1 2 2 21 1 2 2 23 1 2 2
> 23 1 2 2 24 1 2 2 33 1 2 2 33 1 2 2 36 1 2 2 36 1 2 2
> 36 0 2 2 37 1 2 2 45 1 2 2 46 1 2 2 49 0 2 2 49 0 2 2
> 50 0 2 2 50 0 2 2 50 0 2 2 50 0 2 2 50 0 2 2 50 0 2 2
> 51 0 2 2 51 0 2 2 51 0 2 2 51 0 2 2 52 0 2 2 52 0 2 2
> 52 0 2 2 52 0 2 2 52 0 2 2 53 0 2 2 53 0 2 2 53 0 2 2
> 53 0 2 2 53 0 2 2 54 0 2 2 54 0 2 2 54 0 2 2 54 0 2 2
> 55 0 2 2 55 0 2 2 55 0 2 2 55 0 2 2 56 0 2 2 56 0 2 2
> 56 0 2 2 56 0 2 2 56 0 2 2 56 0 2 2 57 0 2 2 57 0 2 2
> 57 0 2 2 57 0 2 2 58 1 2 2 58 1 2 2 58 0 2 2 58 0 2 2
> 58 0 2 2 58 0 2 2 58 0 2 2 58 0 2 2 58 0 2 2 58 0 2 2
> 59 0 2 2 59 0 2 2 59 0 2 2 59 0 2 2 59 0 2 2 60 0 2 2
> 60 0 2 2 60 0 2 2 60 0 2 2 60 0 2 2 60 0 2 2  9 1 3 1
> 12 1 3 1 14 1 3 1 15 1 3 1 15 0 3 1 17 1 3 1 21 1 3 1
> 22 1 3 1 23 1 3 1 23 1 3 1 31 1 3 1 34 1 3 1 35 1 3 1
> 53 0 3 1 60 0 3 1  7 0 3 2  9 1 3 2 17 1 3 2 21 0 3 2
> 22 1 3 2 22 1 3 2 34 1 3 2 34 1 3 2 41 1 3 2 49 0 3 2
> 52 0 3 2 55 1 3 2 56 0 3 2 58 0 3 2 58 0 3 2 59 0 3 2
> 59 0 3 2
> END DATA.
> VAR LABEL stage' Tumour Stage'/ reclevel 'Receptor level'
> /FuTime 'Survival time (months)' /Event 'Censoring Status'.
> VALUE label stage 1'I' 2'II' 3'III'
> /reclevel 1'Low' 2'High' /Event 0'Censored' 1'Event'.
>
> * LML plots for both covariates *.
> COXREG FuTime
>  /STATUS=Event(1)
>  /PATTERN BY stage
>  /PATTERN BY reclevel
>  /CONTRAST (reclevel)=Indicator(1)
>  /CONTRAST (stage)=Indicator(1)
>  /METHOD=ENTER stage reclevel
>  /PLOT LML.
>
>
>
> Marta
>


--
For miscellaneous statistical stuff, visit:
http://gjyp.nl/marta/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: log log plots for cox regression

bgreen
Thanks for the replies Marta & Viann,

I found old posts (2005/2006) referring to the
issue of the plots being based on estimated as
opposed to observed LML plots - so this is still the case?
I don't have SPSS on a machine at home so can't check your syntax just yet.


Are the following lines the relevant commands that generate multiple plots?

/PATTERN BY stage
  /PATTERN BY reclevel

Thanks again

Bob


At 02:36 AM 27/02/2009, Marta GarcĂ­a-Granero wrote:

>Just an afterthought (well two, to be more precise)
>
>1) Forgive my awful syntax: I have a new silicon keyboard with a funny
>temperament, and it simply refuses, at random, to type some "a" and some
>blanks (shift key is also a bit lacy). I like the keyboard because it
>doesn't make any noise (and it's not affected by my teacup-dropping
>habit), but I'm considering switching back to my old "clank-noises" one,
>unless I learn how to make it write everything I actually type.
>
>2) Now, the important question: are you aware that SPSS will give you
>the estimated LML plots, not the observed? There is a trick for getting
>the true (observed) LML plots, just in case you are interested (it
>involves splitting the dataset by the covariate, not using it in the
>model, and asking for LML plot at mean of covariates).
>
>Marta
>
>(losing a lot of time checking what I write)
>
>>Bob Green wrote:
>>>I am hoping for some advice regarding how I can generate multiple log
>>>log plots to test the assumption of proportional hazards.
>>>
>>>'PLOT LML' only will plot one covariate at a time. Is there a way to
>>>select multiple variables so that the plots for all the covariates
>>>(e.g var1, var2, etc) can be produced?
>>Not with the Point&Click, but it can be done with syntax. SelectLML
>>plot for one of the covariates, and click Paste insteadof OK. modify
>>the syntxby adding and extra "/PATTERN bY..." subcommand. See example
>>below.
>>
>>*****************************************************************
>>*                     EXAMPLE DATASET                           *
>>* Table 9.1 Biostatistical Methods in Epidemiology (pp 177-178) *
>>* Stephen C Newman (2001); JOHN WILEY&SONS                      *
>>*****************************************************************.
>>DATA LIST FREE/FuTime Event stage reclevel (4 F8.0).
>>BEGIN DATA
>>50 0 1 1 51 1 1 1 51 0 1 1 53 0 1 1 53 0 1 1 54 0 1 1
>>54 0 1 1 55 0 1 1 56 1 1 1 56 0 1 1 57 0 1 1 60 0 1 1
>>10 1 1 2 34 1 1 2 34 0 1 2 47 1 1 2 47 1 1 2 49 0 1 2
>>49 0 1 2 50 0 1 2 50 0 1 2 50 0 1 2 50 0 1 2 50 0 1 2
>>50 0 1 2 50 0 1 2 51 0 1 2 51 0 1 2 51 0 1 2 51 0 1 2
>>51 0 1 2 51 0 1 2 52 0 1 2 52 0 1 2 52 0 1 2 52 0 1 2
>>52 0 1 2 53 0 1 2 53 0 1 2 53 0 1 2 53 0 1 2 53 0 1 2
>>53 0 1 2 54 0 1 2 54 0 1 2 54 0 1 2 54 0 1 2 54 0 1 2
>>55 0 1 2 55 0 1 2 56 0 1 2 56 0 1 2 57 0 1 2 57 0 1 2
>>57 0 1 2 57 0 1 2 57 0 1 2 58 0 1 2 58 0 1 2 58 0 1 2
>>58 0 1 2 58 0 1 2 59 0 1 2 59 0 1 2 59 0 1 2 59 0 1 2
>>60 0 1 2 60 0 1 2 60 0 1 2  4 0 2 1  9 1 2 1 13 1 2 1
>>21 1 2 1 29 1 2 1 29 1 2 1 40 1 2 1 46 1 2 1 49 0 2 1
>>49 0 2 1 52 0 2 1 52 0 2 1 53 0 2 1 54 0 2 1 55 0 2 1
>>55 0 2 1 56 0 2 1 57 1 2 1 57 0 2 1 58 0 2 1 58 0 2 1
>>59 0 2 1 60 0 2 1 11 1 2 2 16 1 2 2 21 1 2 2 23 1 2 2
>>23 1 2 2 24 1 2 2 33 1 2 2 33 1 2 2 36 1 2 2 36 1 2 2
>>36 0 2 2 37 1 2 2 45 1 2 2 46 1 2 2 49 0 2 2 49 0 2 2
>>50 0 2 2 50 0 2 2 50 0 2 2 50 0 2 2 50 0 2 2 50 0 2 2
>>51 0 2 2 51 0 2 2 51 0 2 2 51 0 2 2 52 0 2 2 52 0 2 2
>>52 0 2 2 52 0 2 2 52 0 2 2 53 0 2 2 53 0 2 2 53 0 2 2
>>53 0 2 2 53 0 2 2 54 0 2 2 54 0 2 2 54 0 2 2 54 0 2 2
>>55 0 2 2 55 0 2 2 55 0 2 2 55 0 2 2 56 0 2 2 56 0 2 2
>>56 0 2 2 56 0 2 2 56 0 2 2 56 0 2 2 57 0 2 2 57 0 2 2
>>57 0 2 2 57 0 2 2 58 1 2 2 58 1 2 2 58 0 2 2 58 0 2 2
>>58 0 2 2 58 0 2 2 58 0 2 2 58 0 2 2 58 0 2 2 58 0 2 2
>>59 0 2 2 59 0 2 2 59 0 2 2 59 0 2 2 59 0 2 2 60 0 2 2
>>60 0 2 2 60 0 2 2 60 0 2 2 60 0 2 2 60 0 2 2  9 1 3 1
>>12 1 3 1 14 1 3 1 15 1 3 1 15 0 3 1 17 1 3 1 21 1 3 1
>>22 1 3 1 23 1 3 1 23 1 3 1 31 1 3 1 34 1 3 1 35 1 3 1
>>53 0 3 1 60 0 3 1  7 0 3 2  9 1 3 2 17 1 3 2 21 0 3 2
>>22 1 3 2 22 1 3 2 34 1 3 2 34 1 3 2 41 1 3 2 49 0 3 2
>>52 0 3 2 55 1 3 2 56 0 3 2 58 0 3 2 58 0 3 2 59 0 3 2
>>59 0 3 2
>>END DATA.
>>VAR LABEL stage' Tumour Stage'/ reclevel 'Receptor level'
>>/FuTime 'Survival time (months)' /Event 'Censoring Status'.
>>VALUE label stage 1'I' 2'II' 3'III'
>>/reclevel 1'Low' 2'High' /Event 0'Censored' 1'Event'.
>>
>>* LML plots for both covariates *.
>>COXREG FuTime
>>  /STATUS=Event(1)
>>  /PATTERN BY stage
>>  /PATTERN BY reclevel
>>  /CONTRAST (reclevel)=Indicator(1)
>>  /CONTRAST (stage)=Indicator(1)
>>  /METHOD=ENTER stage reclevel
>>  /PLOT LML.
>>
>>
>>
>>Marta
>
>
>--
>For miscellaneous statistical stuff, visit:
>http://gjyp.nl/marta/
>
>=====================
>To manage your subscription to SPSSX-L, send a message to
>[hidden email] (not to SPSSX-L), with no body text except the
>command. To leave the list, send the command
>SIGNOFF SPSSX-L
>For a list of commands to manage subscriptions, send the command
>INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD