BookmarkSubscribeRSS Feed
PaulN
Obsidian | Level 7

XLSTAT has a dataset that I uploaded to SAS.  It's the data XLSTAT uses to illustrate a survival analysis model with a Weibull distribution.  I am trying to get the same results in SAS that XLSTAT shows on its website.  Here are the XLSTAT results, as shown on its website.

PaulN_4-1706892798915.png

 

 

PaulN_1-1706892128536.png

 

Here are the SAS Code and SAS Results.  For the most part, the SAS Results match the XLSTAT results.  However, I cannot get SAS to produce the results in the RED CIRCLE. What SAS code must I include to get the results in the red circle?  I've run out of ideas.

 


proc lifereg data=bankrupt.cancerdata plots=probplot;
	a: model daysurv*censoring(0)=month age priorthrp/ distribution=WEIBULL 
		alpha=0.05;
	test /chisq htype=3;
	output out=bankrupt.new cdf=Prob;
run;

PaulN_2-1706892540716.png

PaulN_3-1706892557080.png

 

Any help is appreciated.  Thank you.

 

3 REPLIES 3
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.

PaulN
Obsidian | Level 7

I have attached a SAS dataset.  See below.  

PaulN
Obsidian | Level 7

Here's the result from using the code you provided.

data WORK.CANCERDATA;
   infile datalines dsd truncover;
   input censoring:BEST. daysurv:BEST. month:BEST. age:BEST. priorthrp:BEST.;
   format censoring BEST. daysurv BEST. month BEST. age BEST. priorthrp BEST.;
   label censoring="censoring" daysurv="daysurv" month="month" age="age" priorthrp="priorthrp";
 datalines;
 1 1 7 35 0
 1 1 21 65 10
 1 2 36 44 10
 1 3 3 43 0
 1 4 2 35 0
 1 7 7 72 0
 1 7 11 66 0
 1 7 4 58 0
 1 8 2 68 0
 1 8 19 61 10
 1 8 5 66 0
 1 8 58 63 10
 1 10 23 67 10
 1 10 5 49 0
 1 11 11 48 10
 1 12 4 63 10
 1 12 12 68 10
 1 13 4 56 0
 1 13 2 62 0
 1 15 13 40 10
 1 15 5 63 0
 1 16 4 53 10
 1 18 4 60 0
 1 18 5 69 10
 1 18 15 42 0
 1 19 10 42 0
 1 19 4 39 10
 1 20 5 65 0
 1 20 9 54 10
 1 21 4 71 0
 1 21 2 55 10
 1 22 4 68 0
 1 24 2 60 0
 1 24 8 49 0
 1 25 2 69 0
 1 25 36 63 0
 1 25 2 70 0
 0 25 9 52 10
 1 27 8 62 0
 1 29 8 67 0
 1 30 11 63 0
 1 30 3 61 0
 1 31 3 39 0
 1 31 3 65 0
 1 33 6 64 0
 1 35 6 62 0
 1 36 8 61 0
 1 42 4 81 0
 1 43 11 49 10
 1 44 13 70 10
 1 45 3 69 0
 1 48 4 81 0
 1 49 3 37 0
 1 51 1 67 0
 1 51 5 62 0
 1 51 87 59 10
 1 52 2 55 0
 1 52 3 43 0
 1 52 4 45 0
 1 53 12 66 0
 1 54 4 63 10
 1 54 1 67 0
 1 56 12 43 10
 1 59 2 65 0
 1 61 2 71 0
 1 63 11 48 0
 1 72 7 69 0
 1 73 3 70 0
 1 80 17 71 0
 1 80 4 63 0
 1 82 10 69 10
 0 83 3 57 0
 1 84 4 62 10
 1 87 2 60 0
 0 87 3 48 0
 1 90 22 50 10
 1 92 10 60 0
 1 95 1 61 0
 1 95 4 34 0
 0 97 5 67 0
 1 99 4 62 0
 1 99 3 72 0
 1 100 13 37 10
 0 100 6 70 0
 1 103 5 38 0
 0 103 22 36 10
 1 105 11 66 0
 1 110 29 68 0
 1 111 3 62 0
 1 111 5 64 0
 1 112 6 60 0
 1 117 2 38 0
 1 117 3 46 0
 1 118 11 65 10
 1 122 28 53 0
 0 123 3 55 0
 1 126 9 63 10
 1 132 5 50 0
 1 133 1 65 0
 1 139 2 64 0
 1 140 3 63 0
 1 143 8 60 0
 1 144 4 63 0
 1 151 12 69 0
 1 153 14 63 10
 1 156 2 66 0
 1 162 5 62 0
 1 162 5 64 0
 1 164 15 68 10
 1 177 16 66 10
 0 182 2 62 0
 1 186 3 60 0
 1 200 12 41 10
 1 201 28 52 10
 1 216 15 52 0
 1 228 3 38 0
 1 231 18 67 10
 0 231 8 52 10
 1 242 1 70 0
 1 250 8 53 10
 1 260 5 45 0
 1 278 12 63 0
 1 283 2 51 0
 1 287 25 66 10
 1 314 18 43 0
 1 340 10 64 10
 1 357 13 58 0
 1 378 4 65 0
 1 384 9 42 0
 1 389 2 62 0
 1 392 4 68 0
 1 411 5 64 10
 1 467 2 64 0
 1 553 2 47 0
 1 587 3 58 0
 1 991 7 50 10
 1 999 12 54 10
 ;;;;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 403 views
  • 0 likes
  • 2 in conversation