Programming the statistical procedures from SAS

Custom hypotheses based on likelihood ratio test

Reply
Contributor
Posts: 71

Custom hypotheses based on likelihood ratio test

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;

Respected Advisor
Posts: 2,655

Re: Custom hypotheses based on likelihood ratio test

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

Super Contributor
Posts: 271

Re: Custom hypotheses based on likelihood ratio test

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;

Respected Advisor
Posts: 2,655

Re: Custom hypotheses based on likelihood ratio test

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

Ask a Question
Discussion stats
  • 3 replies
  • 352 views
  • 0 likes
  • 3 in conversation