BookmarkSubscribeRSS Feed
SWEETSAS
Obsidian | Level 7

Hello:

I have survival data that I am analyzing with  PROC PHREG. The data has four continuous variables (x1 x2 x3 x4).

I want to test the hypothesis that the parameter estimate for x2 is equal to a specific value use using likelihood ratio test. The phreg has a TEST statement to achieve this using Wald based test, but I want p-value based on likelihood ratio. The conventional way of conducting likelihood ratio based test is  to fit the model with and without the the variable x2, but this will not work because that test the hypothesis that x2=0. I want to test x2=1.3 using likelihood ratio test.

Assuming I want to test  that x2=1.3, the following SAS statement test my hypothesis of interest, but using Wald test. I want likelihood ratio test. Does any one know if the is an option to achieve this?

The CONTRAST statement does not work for continuous variable. Any hint will be well appreciated.

proc phreg data=foo;

model time*censor(1)=x1 x2 x3 x4;

Test: test x2=1.3;

run;

3 REPLIES 3
SteveDenham
Jade | Level 19

First, fit the model in PHREG as you have it and get the log likelihood.  Then fit again using a dataset where all values of x2 are set to the hypothesized value (here it would be 1.3).  The difference in -2 log likelihood will be distributed as a chi squared variable with one degree of freedom (for the single constraint applied).  Hope this helps.

Steve Denham

JacobSimonsen
Barite | Level 11

I am not sut that I understand Steve answer correct (he usely is correct, so it may be me that have misunderstood him). It is not correct to change the value of the explanatory variable to 1.3. It is the parameter value that should be tested to be 1.3, changing the explanatory value will affect all study-subject, independent of the original value of x2.

Instead, I suggest to create a value which is the product of x2 and 1.3. Put this product into the regression model as an offset. Then test away x2. With type 3 test you can find the likelihood ratio statistic.

data simulation;

  set simulation;

  offset=x2*1.3;

run;

proc phreg data=simulation;

  model t=x2/offset=offset type3(all);

run;

SteveDenham
Jade | Level 19

Oh, geez.  Jacob is absolutely right, and I apologize for my blunder.  Setting all the values to 1.3 will do NOTHING good.  However, fixing the coefficient at 1.3 as Jacob suggest will fit this as requested.

Steve Denham

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1560 views
  • 0 likes
  • 3 in conversation