BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Niugg2010
Obsidian | Level 7

I used two method trying to get quartile estimates: one is using weight statement and another is not. I realize the results are a little differenct.  

Below is my code and results.

Can someone help me figure out why it is different, which result is correct, and how to make the results same. Thanks

 

data x1;
wgt=1;arm=1;
input subjid aval cnsr;
datalines;
1 3.2 0
2 3.7 0
3 6.4 0
4 7.2 0
5 7.3 1
6 9.1 0
7 9.1 1
8 9.2 0
9 11.4 0
10 13.6 0
;

proc lifetest data=x1 ;
time AVAL*CNSR (1);
strata arm/adjust=tukey;
run;
proc lifetest data=x1 ;
weight wgt;
time AVAL*CNSR (1);
strata arm/adjust=tukey;
run;

 

Below is the result without weight statement. 

Capture.JPG

 

Below is the result with weight statement. 

Capture2.JPG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
OsoGris
SAS Employee
Sometimes using WEIGHT=1 for all observations can produce an error. I would try the FREQ statement.

View solution in original post

3 REPLIES 3
OsoGris
SAS Employee
Sometimes using WEIGHT=1 for all observations can produce an error. I would try the FREQ statement.
Niugg2010
Obsidian | Level 7

Thanks. I tried FREQ statement and it produced the same results.

I using Weight statement, becuase sometime all group censor varlue is 1, if without weight the code will produce warnings:
WARNING: The likelihood ratio test for strata homogeneity is questionable since some strata have no events.
Like below example: if without Weight statment or Freq statement, both produce WARNING

if with Weight statement, there is no warning. but the result is different from others.

 

data x1;
wgt=1;
input subjid arm aval cnsr;
datalines;
1 1 3.2 0
2 1 3.7 0
3 1 6.4 0
4 1 7.2 0
5 1 7.3 1
6 1 9.1 0
7 1 9.1 1
8 1 9.2 0
9 1 11.4 0
10 1 13.6 0
5 2 2.3 1
6 2 3.1 1
7 2 6.1 1
8 2 5.2 1
9 2 12.4 1
10 2 11.6 1
;

proc lifetest data=x1 ;
time AVAL*CNSR (1);
strata arm/adjust=tukey;
run;
proc lifetest data=x1 ;
weight wgt;
time AVAL*CNSR (1);
strata arm/adjust=tukey;
run;

proc lifetest data=x1 ;
freq wgt;
time AVAL*CNSR (1);
strata arm/adjust=tukey;
run;
Niugg2010
Obsidian | Level 7

By the way, can you please give me some details, in what conditions Weight statement may produce errors? Since I used Weight statement a lot, and nerver realize this issue.  Thanks

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 1427 views
  • 1 like
  • 2 in conversation