Modelling survival data in MLwiN - Problems! HELP needed

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
Hydend097
Posts: 4
Joined: Sun Jun 18, 2017 8:59 am

Modelling survival data in MLwiN - Problems! HELP needed

Post by Hydend097 »

I've been trying to run multilevel survival analysis following the materials posted by Min Yang & Harvey Goldstein 'Modelling survival data in MLwiN 1.20', but I'm not having much luck.

Firstly, as per guidance on page 6, I set the directory to user defined and assigned a file containing all the macros provided. However, when running the OBEY K-M-estimator.txt command in the command interface window, I get an error message saying MACRO file not found.
In trying to work around this, I simply called in the MACRO and ran it from within ML-Win, which it did successfully.

The second problem I had was that the PRINT request on the Command window didn't work so I didn't get any output of the life-table.

Finally, although I was able to produce some graphs displaying hazard & survival functions, ML-Win simply stopped working when I tried to apply axis titles!

The PC I'm using is Windows 10 with a 64-bit OS and 8GB RAM, and I upgraded to ML-Win 3.01 (64-bit).
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Modelling survival data in MLwiN - Problems! HELP needed

Post by ChrisCharlton »

The macro on page 8 is missing some quote marks (around the macro file names and at the beginning of the second instance of the variable name age2000). The corrected macro should look as follows:

Code: Select all

Name C13 'grp' C14 'time' C15 'right'
Choo 0 'male' 'age2000' 'censored' C13-C15
Obey 'K-M-estimator.txt'
Eras C31-C36
Appen C31 C32 't(i)' 's(t)' C31 C32
Choo 1 'male' 'age2000' 'censored' C13-C15
Obey 'K-M-estimator.txt'
Appen C33 C34 't(i)' 's(t)' C33 C34
Omit 0 60 C31 C32 C31 C32
Omit 0 60 C33 C34 C33 C34 
The PRINT command did work for me, however in order to see the results you need to open the output window. This can be done by clicking on the Output button in the top-left of the command interface window.

The crash that you are seeing when changing the graph axis titles appears to be due to an error in the example worksheet. I will see if I can add code to detect and fix this in the next version of the software. In the mean time if you copy the data to a new worksheet (via copy/paste or export/import) then this should no longer occur.
Hydend097
Posts: 4
Joined: Sun Jun 18, 2017 8:59 am

Re: Modelling survival data in MLwiN - Problems! HELP needed

Post by Hydend097 »

Thank you so much Chris!
Hydend097
Posts: 4
Joined: Sun Jun 18, 2017 8:59 am

Re: Modelling survival data in MLwiN - Problems! HELP needed

Post by Hydend097 »

:-( Sorry Chris,

I'm still having problems. Although print did work, the new code to generate separate survival functions didn't work

error while obeying batch file C:\Users\Debbie\AppData\Local\Temp\tmp2AEC.tmp at line number 1:
Name C13 'grp' C14 'time' C15 'right'
Duplicate column name
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Modelling survival data in MLwiN - Problems! HELP needed

Post by ChrisCharlton »

Is it possible that you have run the macro twice, as columns with these names should not exist otherwise? You can remove all data apart from the original twelve columns with the command:

Code: Select all

ERAS c13-c1500
Hydend097
Posts: 4
Joined: Sun Jun 18, 2017 8:59 am

Re: Modelling survival data in MLwiN - Problems! HELP needed

Post by Hydend097 »

Hi Chris,

I simply copied the text from your earlier reply. However, I since modified it to:-

Choo 0 'male' 'time' 'right' C13-C15
Obey 'K-M-estimator.txt'
Eras C31-C36
Appen C31 C32 't(i)' 's(t)' C31 C32
Choo 1 'male' 'time' 'right' C13-C15
Obey 'K-M-estimator.txt'
Appen C33 C34 't(i)' 's(t)' C33 C34
Omit 0 60 C31 C32 C31 C32
Omit 0 60 C33 C34 C33 C34

and it appears to have worked OK. Except - the output for columns 31 & 32 exactly match those for columns 33 & 34.

Also, while trying to copy the output as a table I got a warning that an unhandled exception had occurred (Value can't be null. Parameter name: text).

At this stage, I'm now convinced that either the data or the guide in http://www.bristol.ac.uk/media-library/ ... s/msdm.pdf is wrong.
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Modelling survival data in MLwiN - Problems! HELP needed

Post by ChrisCharlton »

When I run the macro I posted I get the following values in c31-c34:

Code: Select all

c31	c32		c33	c34
66	0.997207	66	0.993551
67	0.990223	67	0.980284
68	0.97919		68	0.958725
69	0.963827	69	0.925005
70	0.943715	70	0.884282
71	0.925559	71	0.845771
72	0.902374	72	0.806707
73	0.879888	73	0.755298
74	0.854609	74	0.71347
75	0.829609	75	0.66593
76	0.802374	76	0.61839
77	0.774441	77	0.571218
78	0.741341	78	0.525889
79	0.705726	79	0.481113
80	0.67081		80	0.439101
81	0.632542	81	0.398747
82	0.592039	82	0.353602
83	0.549581	83	0.311222
84	0.509218	84	0.273079
85	0.463547	85	0.23291
86	0.41648		86	0.195135
87	0.368575	87	0.163074
88	0.327793	88	0.13267
89	0.285615	89	0.106136
90	0.244553	90	0.0862355
91	0.208101	91	0.069836
92	0.172486	92	0.0547264
93	0.142039	93	0.0423807
94	0.115896	94	0.0322462
95	0.0924325	95	0.0254442
96	0.0704952	96	0.020818
97	0.0550743	97	0.0151915
98	0.0378636	98	0.0113936
Which appear to be different. Your changed code didn't work for me as the columns that you are using in the CHOOse command on are different lengths.

I suspect that the error when using "copy as table" is that you haven't selected the text that you want to copy. If you first highlight this then I think it should copy.

The PDF was written with a much earlier version of MLwiN, so it is quite likely that some things have changed in the mean time.
Post Reply