Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

Survival in EM: missing time IDs

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Survival in EM: missing time IDs

Hello,

 

I am new here. I am using Survival Node, but I keep having error message saying "Must use at least two time ID variables"

 

I have two time ID variables. I don't know why EM keeps saying no time ID variables.

small.png

 

I found that Time ID role & time ID variable are switched. tstart and tstop are variable names. They must be located under "Time ID variable" column, but they are located under "Time ID Role". 

 

error.png

 

Any advice for me?

 

Thanks for your help in advance.


Accepted Solutions
Solution
‎01-03-2017 10:48 AM
SAS Super FREQ
Posts: 272

Re: Survival in EM: missing time IDs

This sounds like the issue described in this SAS note: http://support.sas.com/kb/54/770.html.  There is a work-around described there, and this has been fixed in 14.1 (and also the switching of the labels for Role/Variable).

 

View solution in original post


All Replies
Solution
‎01-03-2017 10:48 AM
SAS Super FREQ
Posts: 272

Re: Survival in EM: missing time IDs

This sounds like the issue described in this SAS note: http://support.sas.com/kb/54/770.html.  There is a work-around described there, and this has been fixed in 14.1 (and also the switching of the labels for Role/Variable).

 

Occasional Contributor
Posts: 12

Re: Survival in EM: missing time IDs

Thanks, Wendy, for your reply.
YES, it resolved my problem.

Occasional Contributor
Posts: 12

Re: Survival in EM: missing time IDs

Hello Wendy,

 

I have a follow-up question for you about forecast intervals.

I keep having run-time error message.

I want to know event probability at future time, 30 days after the censoring date.

The censoing date is 12/31/2015 and I want to know event probability at 1/31/2016.

 

This is my data, partial, with emergency visit records.

As shown below, person A had 2 ER visits in 2015 on 6/29/2015 & 8/14/2015.

For these 2 ER visits, target var is coded as “1”, but the 3rd row shows “censored case”

X1, x2: dependent variables

 

ID

Start_date

Stop_date

_t_

Target var

x1

x2

A

1/1/2015

6/29/2015

179

1

1

1

A

6/30/2015

8/14/2015

46

1

0

1

A

8/15/2015

12/31/2015

139

0

0

1

B

1/1/2015

5/13/2015

132

1

1

0

B

5/14/2015

12/31/2015

232

0

0

0

C

1/1/2015

10/31/2015

303

1

1

0

C

11/1/2015

11/28/2015

28

1

1

0

C

11/29/2015

12/31/2015

33

0

0

0

 

At the survival node,

 

I set up properties:

  • Data format: Fully expanded
  • 2 Time ID variables: start_date & stop_date
  • Time interval: Day
  • Mean Residual Life: None
  • Default Maximum MRL: Yes
  • User Specified Maximum URL: 60
  • Default Forecast Intervals: Yes
  • Number of Forecast Intervals: 30

What is wrong with my property set-up?

 

Just in case you want to see the log, I copy and paste it here:

 

11202     %let SYSCC=0;

11203     %let SYsrc=0;

11204     %let EMEXCEPTIONSTRING=;

11205     %let SYSMSG=;

11206     %em_diagram(action=setproperties, projpath=%nrstr(F:\eMiner\Survival), projname=%nrstr(survival_er), dgmId=EMWS1, requestFile=DiagramSetPropertiesRequest.xml);

NOTE: Fileref _DGMFRF has been deassigned.

WIP_ACTION: OPENSESSION

DGMID: EMWS1

LOCKFILE: F:\eMiner\Survival\survival_er\Workspaces\EMWS1\System\wsopen.lck

11218     %global EM_REFRESH_PROPERTY;

11219     %let EM_REFRESH_PROPERTY=N;

11220     data _null_;

11221     set EMWS1.EM_NODEID;

11222     where upcase(NODEID)=upcase("SURV");

11223     call symput('_EMCLASS', CLASS);

11224     run;

 

NOTE: There were 1 observations read from the data set EMWS1.EM_NODEID.

      WHERE UPCASE(NODEID)='SURV';

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

    cpu time            0.00 seconds

     

 

11226     %let syscc=0;

11227     data WORK._EMVISUALPROPERTIES;

11228     length NODEID CLASS COMPONENT $32 X Y 8 LABEL $81;

11229     NODEID = "EMSave";

11230     CLASS='';

11231     component='';

11232      X = 774;

11233     Y= 148;

11234     LABEL = "Save Data";

11235     output;

11236     NODEID = "Ids";

11237     CLASS='';

11238     component='';

11239     X = 794;

11240     Y= 347;

11241     LABEL = "CELLPHONE_SCORE";

11242     output;

11243     NODEID = "Ids2";

11244     CLASS='';

11245     component='';

11246     X = 66;

11247     Y= 356;

11248     LABEL = "ER_PART2";

11249     output;

11250     NODEID = "Ids3";

11251     CLASS='';

11252     component='';

11253     X = 55;

11254     Y= 143;

11255     LABEL = "ER_PART";

11256     output;

11257     NODEID = "Ids4";

11258     CLASS='';

11259     component='';

11260     X = 414;

11261     Y= 250;

11262     LABEL = "ER_PART_SCORE";

11263     output;

11264     NODEID = "Part";

11265     CLASS='';

11266     component='';

11267     X = 223;

11268     Y= 148;

11269     LABEL = "Data Partition";

11270     output;

11271     NODEID = "Part2";

11272     CLASS='';

11273     component='';

11274     X = 297;

11275     Y= 368;

11276     LABEL = "Data Partition (2)";

11277     output;

11278     NODEID = "SURV";

11279     CLASS='';

11280     component='';

11281     X = 414;

11282     Y= 148;

11283     LABEL = "Survival";

11284     output;

11285      NODEID = "SURV2";

11286     CLASS='';

11287     component='';

11288     X = 483;

11289     Y= 347;

11290     LABEL = "Survival (2)";

11291     output;

11292     NODEID = "Score";

11293     CLASS='';

11294     component='';

11295     X = 594;

11296     Y= 147;

11297     LABEL = "Score";

11298     output;

11299     run;

 

NOTE: The data set WORK._EMVISUALPROPERTIES has 10 observations and 6 variables.

NOTE: DATA statement used (Total process time):

      real time          0.01 seconds

      cpu time            0.00 seconds

     

 

11300     proc sort data=WORK._EMVISUALPROPERTIES;

11301     by NODEID;

11302     run;

 

NOTE: There were 10 observations read from the data set WORK._EMVISUALPROPERTIES.

NOTE: The data set WORK._EMVISUALPROPERTIES has 10 observations and 6 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.00 seconds

     

 

11303     proc sort data=EMWS1.em_nodeid out=_tempNodeid;

11304     by NODEID;

11305     run;

 

NOTE: There were 10 observations read from the data set EMWS1.EM_NODEID.

NOTE: The data set WORK._TEMPNODEID has 10 observations and 8 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

     

 

11306     data _tempNodeid;

11307     update _tempNodeid(in=_a) WORK._EMVISUALPROPERTIES(in=_b);

11308     by NODEID;

11309     if _a then output;

11310     run;

 

NOTE: There were 10 observations read from the data set WORK._TEMPNODEID.

NOTE: There were 10 observations read from the data set WORK._EMVISUALPROPERTIES.

NOTE: The data set WORK._TEMPNODEID has 10 observations and 8 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

     

 

11311     data EMWS1.em_nodeid;

11312     set _tempNodeid;

11313     run;

 

NOTE: There were 10 observations read from the data set WORK._TEMPNODEID.

NOTE: The data set EMWS1.EM_NODEID has 10 observations and 8 variables.

NOTE: DATA statement used (Total process time):

      real time           0.18 seconds

      cpu time            0.01 seconds

     

 

11314     proc datasets lib=WORK nolist;

11315     delete _tempNodeid _EMVISUALPROPERTIES;

11316     run;

 

NOTE: Deleting WORK._TEMPNODEID (memtype=DATA).

NOTE: Deleting WORK._EMVISUALPROPERTIES (memtype=DATA).

11317     quit;

 

NOTE: PROCEDURE DATASETS used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

     

 

11 The SAS System                                                                                                                                                                                                                17:28 Tuesday, January 3, 201

7

 

11318     %let SYSCC=0;

11319     %let SYsrc=0;

11320     %let EMEXCEPTIONSTRING=;

11321     %let SYSMSG=;

11322     %em_diagram(action=closesession, projpath=%nrstr(F:\eMiner\Survival), projname=%nrstr(survival_er), dgmId=EMWS1);

NOTE: Fileref _DGMFRF has been deassigned.

WIP_ACTION: SETPROPERTIES

DGMID: EMWS1

LOCKFILE: F:\eMiner\Survival\survival_er\Workspaces\EMWS1\System\wsopen.lck

NOTE: Libref EMWS1 has been deassigned.

12 The SAS System                                                                                                                                                                                                                 17:28 Tuesday, January 3, 201

7

 

11334     %let SYSCC=0;

11335     %let SYsrc=0;

11336     %let EMEXCEPTIONSTRING=;

11337     %let SYSMSG=;

11338     %em_diagram(action=opensession, projpath=%nrstr(F:\eMiner\Survival), projname=%nrstr(survival_er), dgmId=EMWS1, sessionid=e429951483470324914, outfile=DiagramOpenSessionResponse.xml);

NOTE: Fileref _DGMFRF has been deassigned.

WIP_ACTION: CLOSESESSION

DGMID: EMWS1

LOCKFILE: F:\eMiner\Survival\survival_er\Workspaces\EMWS1\System\wsopen.lck

NOTE: Libref EMWS1 was successfully assigned as follows:

      Engine:        V9

      Physical Name: F:\eMiner\Survival\survival_er\Workspaces\EMWS1

 

NOTE: There were 10 observations read from the data set EMWS1.EM_DGRAPH.

NOTE: The data set WORK.EM_DGRAPH has 10 observations and 2 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

     

 

11350     %let _EM_TREECONVERSION=0;

11351     data _null_;

11352     set EMWS1.EM_NODEID end=eof;

11353     where upcase(Component) ='DECISIONTREE' and CLASS = 'SASHELP.EMMODL.DECISIONTREE.CLASS';

11354     if eof then call symput('_EM_TREECONVERSION', '1');

11355     run;

 

NOTE: There were 0 observations read from the data set EMWS1.EM_NODEID.

      WHERE (UPCASE(Component)='DECISIONTREE') and (CLASS='SASHELP.EMMODL.DECISIONTREE.CLASS');

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

     

 

treeconversion=0

11356      %let syscc=0;

11357     filename _wipchk catalog "EMWS1.EMSave.test.source";

11358     data _null_;

11359     file _wipchk;

11360     put '/* Test */';

11361     run;

 

NOTE: The file _WIPCHK is:

      Catalog Name=EMWS1.EMSAVE.TEST.SOURCE,

      Catalog Page Size=4096,

      Number of Catalog Pages=13,

      Created=Tue, Jan  3, 2017 10:13:03 AM,

      Last Modified=Tue, Jan  3, 2017 05:42:11 PM,

      Filename=F:\eMiner\Survival\survival_er\Workspaces\EMWS1\emsave.sas7bcat,

      Release Created=9.0401M2,Host Created=X64_7PRO

 

NOTE: 1 record was written to the file _WIPCHK.

      The minimum record length was 10.

      The maximum record length was 10.

NOTE: DATA statement used (Total process time):

      real time           0.15 seconds

      cpu time            0.01 seconds

     

 

11362     data _null_;

11363     rc = fdelete('_wipchk');

11364     run;

 

NOTE: DATA statement used (Total process time):

      real time           0.14 seconds

      cpu time            0.00 seconds

     

 

11365     filename _wipchk;

NOTE: Fileref _WIPCHK has been deassigned.

11366     filename _wipxml 'C:\Users\e42995\AppData\Local\Temp\SAS Temporary Files\_TD10148_Y0274_\Prc2\DiagramOpenSessionResponse.xml' encoding="UTF-8" NOBOM;

13 The SAS System                                                                                                                                                                                                                17:28 Tuesday, January 3, 2017

 

SAS Super FREQ
Posts: 272

Re: Survival in EM: missing time IDs

The Survival node does not currently support multiple events per person/ID.  For the fully expanded data, the Start Date, End Date (which is missing for individuals that haven't had an event), and Target should have the same values for all rows with the same ID, with only the _t_ variable (ranging from 0 to the interval corresponding to the end or censor date) and inputs (possibly) changing value.  So I don't think the node will work for your particular case.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 438 views
  • 1 like
  • 2 in conversation