BookmarkSubscribeRSS Feed
marghe
Fluorite | Level 6

Hello all, 

I want to use IPW weights in my survival analysis to get the Kaplan-Meier curve (add the weight statement)  but when I run the procedure I get 

ERRROR: Domain error

ERROR: Floating point exception

 

Is there anyone that can fix it? I need it for my thesis!!

 

Thanks,

Margherita

9 REPLIES 9
Rick_SAS
SAS Super FREQ

First, check the quality of your data. Are the weights all positive? To get basic statistics for the weights, run

 

proc means data=MyData;

var MyWeightVar;

run;

 

If your weights are valid, then post some sample data and the SAS code that you are using so that we can see what you are doing.

marghe
Fluorite | Level 6

I have two sets of weights, normal weights and stabilized weights, here is all the information about my data:

NORMAL WEIGHTS

Variabile di analisi: iptw

N            Average        Std dev         Min              Max

14001.80266810.91067011.01579426.1039446

 

STABILIZED WEIGHTS

Variabile di analisi: iptws

N             Average         Std dev         Min             Max

14000.95366810.36301990.40932052.5291374

 

As you can see they are all positive and not so small, so I don't know where the problem is 😞

 

Here is my dataset ordered by iptws (stabilized weights)

count         trt              sex         age         V1         V2       V3          V4         V5       event_time status   _LEVEL_   logit_ps ps iptw iptws

390TreatmentM747.2525.9320288021Treatment0.837890.698021.432620.40932
344TreatmentM607.3528.41220295831Treatment0.837770.697991.432680.40934
374TreatmentM617.0328.32320293631Treatment0.819850.694211.440500.41157
179TreatmentM768.0126.44220274131Treatment0.792730.688421.452610.41503
68TreatmentM648.8727.89220276641Treatment0.774610.684521.460880.41740
9TreatmentM708.5726.89220252931Treatment0.752190.679661.471330.42038
159TreatmentM778.2227.41320276011Treatment0.734660.675831.479670.42276
12TreatmentM527.6525.75219289321Treatment0.708010.669961.492620.42646
293TreatmentM738.3729.79320295921Treatment0.700240.668241.496470.42756
169TreatmentF637.3825.56320170731Treatment0.677460.663171.507910.43083
297TreatmentM798.7429.3220270640Treatment0.663870.660131.514860.43282
166TreatmentM667.2725.24319283021Treatment0.649810.656971.522150.43490
190TreatmentM668.8329.26320244321Treatment0.647190.656381.523510.43529
354TreatmentM557.9326.08319279821Treatment0.643120.655461.525650.43590
44TreatmentF527.5428.17320177831Treatment0.639790.654711.527410.43640
278TreatmentM777.7625.36319295821Treatment0.615420.649181.540410.44012
184TreatmentM768.225.44319299010Treatment0.612280.648461.542110.44060
210TreatmentM527.9928.47319299121Treatment0.605570.646931.545760.44165
283TreatmentM527.4428.47419299021Treatment0.596960.644961.550480.44300
389TreatmentF568.8528.2320177941Treatment0.595340.644591.551370.44325
360TreatmentM608.6927.01219277911Treatment0.593880.644261.552180.44348
235TreatmentF627.3827.62320159631Treatment0.593510.644171.552390.44354
124TreatmentM527.4826.85319249731Treatment0.587660.642831.555620.44446
261TreatmentF648.4327.8320176740Treatment0.585880.642421.556610.44475
356TreatmentF577.9729.4220174121Treatment0.584670.642141.557290.44494

 

and the procedure I want to run

proc lifetest data=iptw_db atrisk plots=survival(failure cl);
          strata trt;
          weight iptw; *the variable is iptws for stabilized weights;
          time event_time*status(0);
run;

ERROR: Domain error.
ERROR: Floating point exception.

 

 Many thanks!!

Rick_SAS
SAS Super FREQ

You must be running an old version of SAS. Your program runs without error in SAS 940m5.  

 

I found a SAS NOTE that talks about an error when using the STRATA statement in PROC LIFEREG and also requesting the survival plot. Try removing the survival plot request (get rid of the PLOTS= option) and see if that enables your analysis to complete.

marghe
Fluorite | Level 6

Thank you! I tried to get rid of the PLOTS=.. but I got the same error; in any case, unfortunately, I am interested in the weighted survival plot. My SAS version is 9.4 M5 on SAS Studio. I have to find a solution.. maybe writing che code without any procedure.

Rick_SAS
SAS Super FREQ

I'm confused by your statement that you are running SAS 9.4 M5 because that is what I am running.

 

To make sure that we are running the same data, can you run the following and report what happens?

data iptw_db;
input count trt $ sex $ age V1 V2 V3 V4 V5 event_time status logit_ps ps iptw iptws;
datalines;
390   Treatment   M   74  7.25  25.9  3   20  2880  2   1   0.83789 0.69802 1.43262 0.40932
344   Treatment   M   60  7.35  28.41 2   20  2958  3   1   0.83777 0.69799 1.43268 0.40934
374   Treatment   M   61  7.03  28.32 3   20  2936  3   1   0.81985 0.69421 1.44050 0.41157
179   Treatment   M   76  8.01  26.44 2   20  2741  3   1   0.79273 0.68842 1.45261 0.41503
68    Treatment   M   64  8.87  27.89 2   20  2766  4   1   0.77461 0.68452 1.46088 0.41740
9     Treatment   M   70  8.57  26.89 2   20  2529  3   1   0.75219 0.67966 1.47133 0.42038
159   Treatment   M   77  8.22  27.41 3   20  2760  1   1   0.73466 0.67583 1.47967 0.42276
12    Treatment   M   52  7.65  25.75 2   19  2893  2   1   0.70801 0.66996 1.49262 0.42646
293   Treatment   M   73  8.37  29.79 3   20  2959  2   1   0.70024 0.66824 1.49647 0.42756
169   Treatment   F   63  7.38  25.56 3   20  1707  3   1   0.67746 0.66317 1.50791 0.43083
297   Treatment   M   79  8.74  29.3  2   20  2706  4   0   0.66387 0.66013 1.51486 0.43282
166   Treatment   M   66  7.27  25.24 3   19  2830  2   1   0.64981 0.65697 1.52215 0.43490
190   Treatment   M   66  8.83  29.26 3   20  2443  2   1   0.64719 0.65638 1.52351 0.43529
354   Treatment   M   55  7.93  26.08 3   19  2798  2   1   0.64312 0.65546 1.52565 0.43590
44    Treatment   F   52  7.54  28.17 3   20  1778  3   1   0.63979 0.65471 1.52741 0.43640
278   Treatment   M   77  7.76  25.36 3   19  2958  2   1   0.61542 0.64918 1.54041 0.44012
184   Treatment   M   76  8.2   25.44 3   19  2990  1   0   0.61228 0.64846 1.54211 0.44060
210   Treatment   M   52  7.99  28.47 3   19  2991  2   1   0.60557 0.64693 1.54576 0.44165
283   Treatment   M   52  7.44  28.47 4   19  2990  2   1   0.59696 0.64496 1.55048 0.44300
389   Treatment   F   56  8.85  28.2  3   20  1779  4   1   0.59534 0.64459 1.55137 0.44325
360   Treatment   M   60  8.69  27.01 2   19  2779  1   1   0.59388 0.64426 1.55218 0.44348
235   Treatment   F   62  7.38  27.62 3   20  1596  3   1   0.59351 0.64417 1.55239 0.44354
124   Treatment   M   52  7.48  26.85 3   19  2497  3   1   0.58766 0.64283 1.55562 0.44446
261   Treatment   F   64  8.43  27.8  3   20  1767  4   0   0.58588 0.64242 1.55661 0.44475
356   Treatment   F   57  7.97  29.4  2   20  1741  2   1   0.58467 0.64214 1.55729 0.44494
;

proc lifetest data=iptw_db atrisk plots=survival(failure cl);
          strata trt;
          weight iptw; *the variable is iptws for stabilized weights;
          time event_time*status(0);
run;
marghe
Fluorite | Level 6

This code produces the plot I need but the dataset I copied in the previous post is just a portion of the whole dataset. So, the error must be related to the dataset.

ashishpople1562
Calcite | Level 5

I am facing the similar issue, Domain error , floating point exception. Can you tell what was the problem with the dataset that you were unable to run analysis on entire data. It would be great if you reply ASAP. 

 

Thanks in advance

Rick_SAS
SAS Super FREQ

Do you get the error for the data set in this thread?  

 

If you get the error for some data but not for other data, then something about the data is causing the problem. Sometimes you can determine the problem by running the program on a subset of the data. For example, if the problem goes away when you use 
proc lifetest data=Have(OBS=500);

then that is valuable information.  

 

If you can post your data here, then please do. If you cannot post your data because it is too large (or proprietary), then open a ticket with SAS Technical Support. They can make arrangements to obtain the data.

 

ashishpople1562
Calcite | Level 5

I cannot share the data due to certain constraints, actual data has more than 50k observations, we tried running with (obs=500) and (obs=1000) the model gave output. We also tried running the model with weight = 1 still we faced the domain error.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 2709 views
  • 5 likes
  • 3 in conversation